summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-11-12 16:04:57 (GMT)
committeraxis <qt-info@nokia.com>2009-11-12 16:04:57 (GMT)
commit8e589bc0aa6df55052e37b3107f2f03a1dc17d06 (patch)
tree5f07c9d2bc99c2bd43fe462458d8423fb14715be
parente6558e8b25897ba9ac0a553509a0056915b0eb5c (diff)
parent5bc53cb71f22d74cf13bef7e8cae25833b40d0b4 (diff)
downloadQt-8e589bc0aa6df55052e37b3107f2f03a1dc17d06.zip
Qt-8e589bc0aa6df55052e37b3107f2f03a1dc17d06.tar.gz
Qt-8e589bc0aa6df55052e37b3107f2f03a1dc17d06.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-staging2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h3
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp35
2 files changed, 21 insertions, 17 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index 6aee669..d0b488e 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -84,7 +84,7 @@ public:
bool filterEvent(const QEvent *event);
void mouseHandler( int x, QMouseEvent *event);
- bool isComposing() const { return m_isEditing; }
+ bool isComposing() const { return !m_preeditString.isEmpty(); }
void setFocusWidget(QWidget * w);
void widgetDestroyed(QWidget *w);
@@ -140,7 +140,6 @@ private:
QString m_preeditString;
Qt::InputMethodHints m_lastImHints;
TUint m_textCapabilities;
- bool m_isEditing;
bool m_inDestruction;
bool m_pendingInputCapabilitiesChanged;
int m_cursorVisibility;
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 0ed3cc0..08d86d7 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -65,7 +65,6 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_fepState(q_check_ptr(new CAknEdwinState)), // CBase derived object needs check on new
m_lastImHints(Qt::ImhNone),
m_textCapabilities(TCoeInputCapabilities::EAllText),
- m_isEditing(false),
m_inDestruction(false),
m_pendingInputCapabilitiesChanged(false),
m_cursorVisibility(1),
@@ -204,14 +203,26 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event);
- Q_ASSERT(m_lastImHints == focusWidget()->inputMethodHints());
- if (keyEvent->key() == Qt::Key_F20 && m_lastImHints & Qt::ImhHiddenText) {
- // Special case in Symbian. On editors with secret text, F20 is for some reason
- // considered to be a backspace.
- QKeyEvent modifiedEvent(keyEvent->type(), Qt::Key_Backspace, keyEvent->modifiers(),
- keyEvent->text(), keyEvent->isAutoRepeat(), keyEvent->count());
- QApplication::sendEvent(focusWidget(), &modifiedEvent);
- return true;
+ switch (keyEvent->key()) {
+ case Qt::Key_F20:
+ Q_ASSERT(m_lastImHints == focusWidget()->inputMethodHints());
+ if (m_lastImHints & Qt::ImhHiddenText) {
+ // Special case in Symbian. On editors with secret text, F20 is for some reason
+ // considered to be a backspace.
+ QKeyEvent modifiedEvent(keyEvent->type(), Qt::Key_Backspace, keyEvent->modifiers(),
+ keyEvent->text(), keyEvent->isAutoRepeat(), keyEvent->count());
+ QApplication::sendEvent(focusWidget(), &modifiedEvent);
+ return true;
+ }
+ break;
+ case Qt::Key_Select:
+ if (!m_preeditString.isEmpty()) {
+ commitCurrentString(false);
+ return true;
+ }
+ break;
+ default:
+ break;
}
}
@@ -245,7 +256,6 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event)
{
- Q_ASSERT(m_isEditing);
Q_ASSERT(focusWidget());
if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) {
@@ -488,8 +498,6 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText,
if (!w)
return;
- m_isEditing = true;
-
m_cursorPos = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
QList<QInputMethodEvent::Attribute> attributes;
@@ -555,8 +563,6 @@ void QCoeFepInputContext::CancelFepInlineEdit()
event.setCommitString(QLatin1String(""), 0, 0);
m_preeditString.clear();
sendEvent(event);
-
- m_isEditing = false;
}
TInt QCoeFepInputContext::DocumentLengthForFep() const
@@ -711,7 +717,6 @@ void QCoeFepInputContext::commitCurrentString(bool triggeredBySymbian)
sendEvent(event);
m_longPress = 0;
- m_isEditing = false;
if (!triggeredBySymbian) {
CCoeFep* fep = CCoeEnv::Static()->Fep();