summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qlinecontrol.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-28 07:59:43 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-28 07:59:43 (GMT)
commit0d70b0a9faecf042fdb20e0056bdaaec289b851c (patch)
tree5ad6397fbab4dac6b37f740256aa585183e147c1 /src/gui/widgets/qlinecontrol.cpp
parentd45ec470519d1075ebf299b74cbb846a0c7d99af (diff)
parentce4996b624678f37b13fbb7db810cccd8970a889 (diff)
downloadQt-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.cpp12
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;
}