summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-04-22 16:04:19 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-04-22 16:04:19 (GMT)
commitcce89db1e2555cbca8fc28072e1c6dd737cec6c4 (patch)
tree13b8e5aaff7c529860a6b1458a2cfe27158414e2 /src/gui/widgets
parent1b95c4e6502ede5a980aaf5a2ed9dad283b3eadd (diff)
parent87c03292dce257f1f72d3fdc4e9457f1e1269ce2 (diff)
downloadQt-cce89db1e2555cbca8fc28072e1c6dd737cec6c4.zip
Qt-cce89db1e2555cbca8fc28072e1c6dd737cec6c4.tar.gz
Qt-cce89db1e2555cbca8fc28072e1c6dd737cec6c4.tar.bz2
Merge branch 4.7 into qt-4.8-from-4.7
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qlinecontrol.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 606ba05..289faa9 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();