diff options
author | Samuel Nevala <samuel.nevala@digia.com> | 2009-11-20 10:48:48 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-11-24 13:53:53 (GMT) |
commit | 7db46e32124ad902eb08baaa146f84403b1fbcbd (patch) | |
tree | 332d5c0967ad7cbe1fd6af2d6b454694ef0a23f2 /src/gui/text | |
parent | 0d833e51a1917433a9fb77080632a5803ab6deb8 (diff) | |
download | Qt-7db46e32124ad902eb08baaa146f84403b1fbcbd.zip Qt-7db46e32124ad902eb08baaa146f84403b1fbcbd.tar.gz Qt-7db46e32124ad902eb08baaa146f84403b1fbcbd.tar.bz2 |
Softkeys: Text disappears from textbox when predictive text is active.
If two QInputMethodEvent("preedittext", attributes) or more are send in a row, textedit is drawn empty.
Event creates lines based on isGettingInput flag and clears line every time there is preedit text.
On 2nd event lines are cleared but not created since e->preeditString() != cursor.block().layout()->preeditAreaText() set isGettingInput to zero.
When draw begins line count is checked. If no lines return. Moved layout->setPreeditArea() under if (isGettingInput) so pre-edit text is set only when text really changes.
http://bugreports.qt.nokia.com/browse/QTBUG-4696
Task-number:QTBUG-4696
Reviewed-by:Markku Luukkainen
Merge-request: 2132
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index be79773..90e876c 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1876,7 +1876,8 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) QTextBlock block = cursor.block(); QTextLayout *layout = block.layout(); - layout->setPreeditArea(cursor.position() - block.position(), e->preeditString()); + if (isGettingInput) + layout->setPreeditArea(cursor.position() - block.position(), e->preeditString()); QList<QTextLayout::FormatRange> overrides; preeditCursor = e->preeditString().length(); hideCursor = false; |