diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-04-28 07:59:43 (GMT) |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-04-28 07:59:43 (GMT) |
commit | 0d70b0a9faecf042fdb20e0056bdaaec289b851c (patch) | |
tree | 5ad6397fbab4dac6b37f740256aa585183e147c1 /src/gui/widgets/qlinecontrol.cpp | |
parent | d45ec470519d1075ebf299b74cbb846a0c7d99af (diff) | |
parent | ce4996b624678f37b13fbb7db810cccd8970a889 (diff) | |
download | Qt-0d70b0a9faecf042fdb20e0056bdaaec289b851c.zip Qt-0d70b0a9faecf042fdb20e0056bdaaec289b851c.tar.gz Qt-0d70b0a9faecf042fdb20e0056bdaaec289b851c.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Conflicts:
src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'src/gui/widgets/qlinecontrol.cpp')
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 5a281ad..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(); @@ -435,7 +443,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) removeSelectedText(); } if (!event->commitString().isEmpty()) { - insert(event->commitString()); + internalInsert(event->commitString()); cursorPositionChanged = true; } |