diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-21 13:18:20 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-21 13:18:20 (GMT) |
commit | 87c03292dce257f1f72d3fdc4e9457f1e1269ce2 (patch) | |
tree | 2f18f87f0fc96349b3ae36687a8e4b31a0e089be /src/gui/widgets | |
parent | 43bce78bd5a41115ab5a541243cc3edcecd2904e (diff) | |
parent | f14ac31c86eeb53d0b08c799ad0ad895d17475d6 (diff) | |
download | Qt-87c03292dce257f1f72d3fdc4e9457f1e1269ce2.zip Qt-87c03292dce257f1f72d3fdc4e9457f1e1269ce2.tar.gz Qt-87c03292dce257f1f72d3fdc4e9457f1e1269ce2.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Document section behavior when not ordered by section
Fix TextInput cursor position unchanged when selection length is 0.
Fix TextInput echoMode clearing inputMethodHints set by the user.
Elide has unexpected effect on Text's implicitWidth
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index d03e5de..202ea7a 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -254,12 +254,20 @@ void QLineControl::setSelection(int start, int length) m_selstart = start; m_selend = qMin(start + length, (int)m_text.length()); m_cursor = m_selend; - } else { + } else if (length < 0){ if (start == m_selend && start + length == m_selstart) return; m_selstart = qMax(start + length, 0); m_selend = start; m_cursor = m_selstart; + } else if (m_selstart != m_selend) { + m_selstart = 0; + m_selend = 0; + m_cursor = start; + } else { + m_cursor = start; + emitCursorPositionChanged(); + return; } emit selectionChanged(); emitCursorPositionChanged(); |