summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-07-20 03:20:27 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-07-20 03:20:27 (GMT)
commit7b1484e05a28c20a993efe0c2ec42ae25cbff13f (patch)
treecd305a1e2f9e6376449687c59e3f5447b58d6603 /src/gui
parent139b29f6ac99380a4f6fb47d0eca650c67757005 (diff)
downloadQt-7b1484e05a28c20a993efe0c2ec42ae25cbff13f.zip
Qt-7b1484e05a28c20a993efe0c2ec42ae25cbff13f.tar.gz
Qt-7b1484e05a28c20a993efe0c2ec42ae25cbff13f.tar.bz2
Emit selectionChange when setSelection is called
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/qlinecontrol.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 97f4a45..eec890b 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -244,14 +244,19 @@ void QLineControl::setSelection(int start, int length)
}
if (length > 0) {
+ if (start == m_selstart && start + length == m_selend)
+ return;
m_selstart = start;
m_selend = qMin(start + length, (int)m_text.length());
m_cursor = m_selend;
} else {
+ if (start == m_selend && start + length == m_selstart)
+ return;
m_selstart = qMax(start + length, 0);
m_selend = start;
m_cursor = m_selstart;
}
+ emit selectionChanged();
}
void QLineControl::_q_clipboardChanged()