Update QLineControl's state correctly with QT_NO_ACCESSIBLITY.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Tue, 27 Sep 2011 07:21:16 +0000 (17:21 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 27 Sep 2011 07:58:44 +0000 (09:58 +0200)
Always call finishChange in setText, not just when QT_NO_ACCESSIBILITY
is undefined, otherwise lots of things don't get updated.

Task-number: QTBUG-21686
Change-Id: I58b320814fb379b462e39b7e675fe6e9fc41ba8a
Reviewed-on: http://codereview.qt-project.org/5594
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/gui/text/qlinecontrol.cpp

index 0113f4b..33de367 100644 (file)
@@ -654,10 +654,10 @@ void QLineControl::internalSetText(const QString &txt, int pos, bool edited)
     m_cursor = (pos < 0 || pos > m_text.length()) ? m_text.length() : pos;
     m_textDirty = (oldText != m_text);
 
+    bool changed = finishChange(-1, true, edited);
 #ifdef QT_NO_ACCESSIBILITY
-    Q_UNUSED(edited)
+    Q_UNUSED(changed)
 #else
-    bool changed = finishChange(-1, true, edited);
     if (changed)
         QAccessible::updateAccessibility(parent(), 0, QAccessible::TextUpdated);
 #endif