From 7b1484e05a28c20a993efe0c2ec42ae25cbff13f Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 20 Jul 2009 13:20:27 +1000 Subject: Emit selectionChange when setSelection is called --- src/gui/widgets/qlinecontrol.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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() -- cgit v0.12