diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2012-01-25 14:15:29 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-12 13:32:21 +0200 |
commit | adf3f8a72af5114e0b372f952d2ad94bb8511adb (patch) | |
tree | 35659df3d8de4efaff1d01cfcf1fbf38de77d55b /src/quick/items/qquicktextcontrol.cpp | |
parent | 1b0bcbbe749529c9b3c37f79f9535293544c4fbb (diff) |
QQuickTextEdit to trigger input method updates on selectAll()
Change-Id: I8642eca0e584b811308b73817e7decf2f392f1b5
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'src/quick/items/qquicktextcontrol.cpp')
-rw-r--r-- | src/quick/items/qquicktextcontrol.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp index 739b5f859b..f63e6a7523 100644 --- a/src/quick/items/qquicktextcontrol.cpp +++ b/src/quick/items/qquicktextcontrol.cpp @@ -46,7 +46,6 @@ #include <qcoreapplication.h> #include <qfont.h> -#include <qpainter.h> #include <qevent.h> #include <qdebug.h> #include <qdrag.h> @@ -60,8 +59,6 @@ #include "qtextlist.h" #include "qtextdocumentwriter.h" #include "private/qtextcursor_p.h" -#include "qpagedpaintdevice.h" -#include "private/qpagedpaintdevice_p.h" #include <qtextformat.h> #include <qdatetime.h> @@ -429,8 +426,11 @@ void QQuickTextControlPrivate::repaintOldAndNewSelection(const QTextCursor &oldS void QQuickTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /*=false*/) { Q_Q(QQuickTextControl); - if (forceEmitSelectionChanged) + if (forceEmitSelectionChanged) { + if (hasFocus) + qGuiApp->inputMethod()->update(Qt::ImCurrentSelection); emit q->selectionChanged(); + } bool current = cursor.hasSelection(); if (current == lastSelectionState) @@ -438,8 +438,11 @@ void QQuickTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged / lastSelectionState = current; emit q->copyAvailable(current); - if (!forceEmitSelectionChanged) + if (!forceEmitSelectionChanged) { + if (hasFocus) + qGuiApp->inputMethod()->update(Qt::ImCurrentSelection); emit q->selectionChanged(); + } emit q->cursorRectangleChanged(); } |