diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-23 00:18:59 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-23 00:18:59 (GMT) |
commit | fff467981fe515974e722e1d092a916f6a8f5dcc (patch) | |
tree | 33543eb688df3ecbfe02a2d3f0b6fc54b8ba15ec /src/gui/inputmethod/qcoefepinputcontext_s60.cpp | |
parent | 11f20a34cbad9797545ab4eb638ff311af6fc6fc (diff) | |
parent | 031958c130904c16a4bafa5617aaa197469efa9e (diff) | |
download | Qt-fff467981fe515974e722e1d092a916f6a8f5dcc.zip Qt-fff467981fe515974e722e1d092a916f6a8f5dcc.tar.gz Qt-fff467981fe515974e722e1d092a916f6a8f5dcc.tar.bz2 |
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-water-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-water-team: (269 commits)
Incorrect property name in QAccessibleAbstractSpinBox::setCurrentValue
DEF file updates for Symbian
QTBUG-19883 Adding top level TRAP for QThreads on Symbian
Revert "QFileInfoGatherer: call QFileSystemWatcher addPaths from proper thread"
Fix alignment value not handled in ODF
Silence a compiler warning about unhandled enum in switch
Silence the "array out of bounds" warning in GCC 4.6.
Silence the callgrind warnings in our source code when using gcc 4.6
Create a function that merges the SSE common code
Improve toLatin1 x86 SIMD by using a new SSE4.1 instruction
Revert "Fix compilation of lrelease on Windows"
QFileInfoGatherer: call QFileSystemWatcher addPaths from proper thread
Also test http proxy in the QTcpServer benchmark
Symbian QFileSystemWatcher: fix potential crash
Enable QTcpServer benchmark on symbian
Fix building the OpenVG graphicssystem on Linux with static libs
fix build on windows 7
Fix compilation of lrelease on Windows
Allow selecting fonts with irregular style names
When asking for relations, don't crash on children that don't return an interface.
...
Diffstat (limited to 'src/gui/inputmethod/qcoefepinputcontext_s60.cpp')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index daa448b..ebf0ff8 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -141,6 +141,16 @@ QCoeFepInputContext::~QCoeFepInputContext() void QCoeFepInputContext::reset() { + Qt::InputMethodHints currentHints = Qt::ImhNone; + if (focusWidget()) { + QWidget *proxy = focusWidget()->focusProxy(); + currentHints = proxy ? proxy->inputMethodHints() : focusWidget()->inputMethodHints(); + } + // Store a copy of preedit text, if prediction is active and input context is reseted. + // This is to ensure that we can replace preedit string after losing focus to FEP manager's + // internal sub-windows. + if (m_cachedPreeditString.isEmpty() && !(currentHints & Qt::ImhNoPredictiveText)) + m_cachedPreeditString = m_preeditString; commitCurrentString(true); } @@ -175,6 +185,8 @@ void QCoeFepInputContext::setFocusWidget(QWidget *w) void QCoeFepInputContext::widgetDestroyed(QWidget *w) { + m_cachedPreeditString.clear(); + // Make sure that the input capabilities of whatever new widget got focused are queried. CCoeControl *ctrl = w->effectiveWinId(); if (ctrl->IsFocused()) { @@ -353,6 +365,11 @@ bool QCoeFepInputContext::symbianFilterEvent(QWidget *keyWidget, const QSymbianE } } + if (event->type() == QSymbianEvent::ResourceChangeEvent + && event->resourceChangeType() == KEikMessageFadeAllWindows) { + reset(); + } + return false; } @@ -826,13 +843,6 @@ void QCoeFepInputContext::applyFormat(QList<QInputMethodEvent::Attribute> *attri } } - if (attributes->size() == oldSize) { - // S60 didn't provide any format, so let's give our own instead. - attributes->append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, - 0, - m_preeditString.size(), - standardFormat(PreeditFormat))); - } } void QCoeFepInputContext::queueInputCapabilitiesChanged() @@ -862,6 +872,8 @@ void QCoeFepInputContext::ensureInputCapabilitiesChanged() void QCoeFepInputContext::translateInputWidget() { QGraphicsView *gv = qobject_cast<QGraphicsView *>(S60->splitViewLastWidget); + if (!gv) + return; QRect splitViewRect = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect()); QRectF cursor = gv->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF(); @@ -909,6 +921,8 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, if (!w) return; + m_cachedPreeditString.clear(); + commitTemporaryPreeditString(); QList<QInputMethodEvent::Attribute> attributes; @@ -965,7 +979,10 @@ void QCoeFepInputContext::UpdateFepInlineTextL(const TDesC& aNewInlineText, QVariant())); QString newPreeditString = qt_TDesC2QString(aNewInlineText); QInputMethodEvent event(newPreeditString, attributes); - if (newPreeditString.isEmpty() && m_preeditString.isEmpty()) { + if (!m_cachedPreeditString.isEmpty()) { + event.setCommitString(QLatin1String(""), -m_cachedPreeditString.length(), m_cachedPreeditString.length()); + m_cachedPreeditString.clear(); + } else if (newPreeditString.isEmpty() && m_preeditString.isEmpty()) { // In Symbian world this means "erase last character". event.setCommitString(QLatin1String(""), -1, 1); } @@ -1155,7 +1172,18 @@ void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction) m_hasTempPreeditString = false; - if (cancelFepTransaction) { + //Only cancel FEP transactions with prediction, when there is still active window. + Qt::InputMethodHints currentHints = Qt::ImhNone; + if (focusWidget()) { + if (focusWidget()->focusProxy()) + currentHints = focusWidget()->focusProxy()->inputMethodHints(); + else + currentHints = focusWidget()->inputMethodHints(); + } + bool predictive = !(currentHints & Qt::ImhNoPredictiveText); + bool widgetAndWindowAvailable = QApplication::activeWindow() && focusWidget(); + + if (cancelFepTransaction && ((predictive && widgetAndWindowAvailable) || !predictive)) { CCoeFep* fep = CCoeEnv::Static()->Fep(); if (fep) fep->CancelTransaction(); |