summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextcontrol.cpp
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-04-07 06:21:27 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2011-04-13 01:42:29 (GMT)
commitc7833b8f5ecc7a47e35bdf9fbb528e1869979ef5 (patch)
treefd6be98a04811974bbe1c2605bede9b65aa11666 /src/gui/text/qtextcontrol.cpp
parentc17150344510fc5fe239e39e6659bd16579586e8 (diff)
downloadQt-c7833b8f5ecc7a47e35bdf9fbb528e1869979ef5.zip
Qt-c7833b8f5ecc7a47e35bdf9fbb528e1869979ef5.tar.gz
Qt-c7833b8f5ecc7a47e35bdf9fbb528e1869979ef5.tar.bz2
Fix TextEdit cursorRectangle property.
Translate the cursor rectangle from control coordinates to painting coordinates rather than the other way around, ensure the cursor delegate is also translated, and update the cursor rectangle, cursor delegate and micro focus when the preedit cursor changes position. Change-Id: Iac7a87f7fb965d5f56d059d8f4b97feef8b47789 Task-number: QTBUG-18515 QT-4827 Reviewed-by: Martin Jones
Diffstat (limited to 'src/gui/text/qtextcontrol.cpp')
-rw-r--r--src/gui/text/qtextcontrol.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 1a81394..bee4d95 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1950,6 +1950,7 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
if (isGettingInput)
layout->setPreeditArea(cursor.position() - block.position(), e->preeditString());
QList<QTextLayout::FormatRange> overrides;
+ const int oldPreeditCursor = preeditCursor;
preeditCursor = e->preeditString().length();
hideCursor = false;
for (int i = 0; i < e->attributes().size(); ++i) {
@@ -1970,6 +1971,8 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
}
layout->setAdditionalFormats(overrides);
cursor.endEditBlock();
+ if (oldPreeditCursor != preeditCursor)
+ emit q->microFocusChanged();
}
QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const