diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-09-16 10:10:14 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-09-16 13:00:34 +0200 |
commit | 0e3f52de17e92fb83307dafe132363a57ce30941 (patch) | |
tree | fea6f2db90b21b15334c40a2536c7e77713e4cf3 /src/quick/items/qquicktextcontrol.cpp | |
parent | abff566ff85eb1fdee12e8a0fffddb7c1ff2dd7c (diff) |
QQuickTextControl: update cursor rect when cursor changes position
If the text cursor changes position by indirect manipulation of the
document that backs a QQuickTextControl, we need to inform that
the cursor rect changed as well.
This will fix a bug with QQuickTextEdit that caused the platform input
method to be out of sync since the cursor rect signal was never
emitted from the the text control.
Task-number: QTBUG-41042
Change-Id: Idcf35a2d51c8dffcb80ba21f8e59a61e04e5a879
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'src/quick/items/qquicktextcontrol.cpp')
-rw-r--r-- | src/quick/items/qquicktextcontrol.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp index a263a890b5..2585caefb5 100644 --- a/src/quick/items/qquicktextcontrol.cpp +++ b/src/quick/items/qquicktextcontrol.cpp @@ -435,12 +435,12 @@ void QQuickTextControlPrivate::setClipboardSelection() } #endif -void QQuickTextControlPrivate::_q_emitCursorPosChanged(const QTextCursor &someCursor) +void QQuickTextControlPrivate::_q_updateCursorPosChanged(const QTextCursor &someCursor) { Q_Q(QQuickTextControl); if (someCursor.isCopyOf(cursor)) { emit q->cursorPositionChanged(); - cursorRectangleChanged = true; + q->updateCursorRectangle(true); } } @@ -578,7 +578,7 @@ QQuickTextControl::QQuickTextControl(QTextDocument *doc, QObject *parent) qmlobject_connect(layout, QAbstractTextDocumentLayout, SIGNAL(updateBlock(QTextBlock)), this, QQuickTextControl, SIGNAL(updateRequest())); qmlobject_connect(doc, QTextDocument, SIGNAL(contentsChanged()), this, QQuickTextControl, SIGNAL(textChanged())); qmlobject_connect(doc, QTextDocument, SIGNAL(contentsChanged()), this, QQuickTextControl, SLOT(_q_updateCurrentCharFormatAndSelection())); - qmlobject_connect(doc, QTextDocument, SIGNAL(cursorPositionChanged(QTextCursor)), this, QQuickTextControl, SLOT(_q_emitCursorPosChanged(QTextCursor))); + qmlobject_connect(doc, QTextDocument, SIGNAL(cursorPositionChanged(QTextCursor)), this, QQuickTextControl, SLOT(_q_updateCursorPosChanged(QTextCursor))); connect(doc, &QTextDocument::contentsChange, this, &QQuickTextControl::contentsChange); layout->setProperty("cursorWidth", textCursorWidth); |