aboutsummaryrefslogtreecommitdiffstats
path: root/src/qtquick1/graphicsitems
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-07-25 13:17:35 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-25 08:15:47 +0200
commit3bb8c0d3f2115765b519f795a2898456bf31924b (patch)
tree0465280f1a97056c688528776dc839022c5b07c8 /src/qtquick1/graphicsitems
parent9f9b23fd7943a3d125cb1cc9f333ce430b2706ea (diff)
Scroll correctly when cursorPosition is changed within onTextChanged.
Emit textChanged() before adjusting size and scroll positions otherwise the calculations will be based on the cursor position before it's moved in handler and because the cursor position won't ultimately have changed there won't be a follow up cursorPositionChanged() signal to trigger a second set of calculation. Task-number: QTBUG-19912 Reviewed-by: Martin Jones (cherry picked from commit bb11b53bedb8e239b9439b4a3fc3320e35c2de57) Conflicts: src/declarative/graphicsitems/qdeclarativetextinput.cpp Change-Id: I579bc3fe6c80766dfadfbc9dbd46144607bf7b03 Reviewed-on: http://codereview.qt.nokia.com/2058 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Diffstat (limited to 'src/qtquick1/graphicsitems')
-rw-r--r--src/qtquick1/graphicsitems/qdeclarativetextinput.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qtquick1/graphicsitems/qdeclarativetextinput.cpp b/src/qtquick1/graphicsitems/qdeclarativetextinput.cpp
index 582e3c7e0c..9a291ea524 100644
--- a/src/qtquick1/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/qtquick1/graphicsitems/qdeclarativetextinput.cpp
@@ -1948,12 +1948,12 @@ void QDeclarative1TextInput::selectionChanged()
void QDeclarative1TextInput::q_textChanged()
{
Q_D(QDeclarative1TextInput);
+ emit textChanged();
+ emit displayTextChanged();
updateSize();
d->determineHorizontalAlignment();
d->updateHorizontalScroll();
updateMicroFocus();
- emit textChanged();
- emit displayTextChanged();
if(hasAcceptableInput() != d->oldValidity){
d->oldValidity = hasAcceptableInput();
emit acceptableInputChanged();