diff options
author | Christopher Ham <christopher.ham@nokia.com> | 2010-12-06 05:46:47 (GMT) |
---|---|---|
committer | Christopher Ham <christopher.ham@nokia.com> | 2010-12-06 05:54:21 (GMT) |
commit | b74ec2156b2a1f1acd38443047da5bb26cb082b1 (patch) | |
tree | f550010a6856beb11aa42dc44876cd051bb7ab1a /src/gui/widgets | |
parent | ac977c4d57eba8fe2b71e51fc3d0b5eddd416e17 (diff) | |
download | Qt-b74ec2156b2a1f1acd38443047da5bb26cb082b1.zip Qt-b74ec2156b2a1f1acd38443047da5bb26cb082b1.tar.gz Qt-b74ec2156b2a1f1acd38443047da5bb26cb082b1.tar.bz2 |
Cursor shouldn't blink while dragging cursor position
A function resetCursorBlinkerTimer was introduced to QLineControl.
Each time the cursor position in a textInput is updated, the blinker
timer is reset.
Task-number: QTBUG-15815
Reviewed-by: Martin Jones
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/qlinecontrol_p.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index f338f40..5ea9dc4 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -1308,6 +1308,15 @@ void QLineControl::setCursorBlinkPeriod(int msec) m_blinkPeriod = msec; } +void QLineControl::resetCursorBlinkTimer() +{ + if (m_blinkPeriod == 0 || m_blinkTimer == 0) + return; + killTimer(m_blinkTimer); + m_blinkTimer = startTimer(m_blinkPeriod / 2); + m_blinkStatus = 1; +} + void QLineControl::timerEvent(QTimerEvent *event) { if (event->timerId() == m_blinkTimer) { diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h index 7068f62..d881acf 100644 --- a/src/gui/widgets/qlinecontrol_p.h +++ b/src/gui/widgets/qlinecontrol_p.h @@ -296,6 +296,7 @@ public: int cursorBlinkPeriod() const { return m_blinkPeriod; } void setCursorBlinkPeriod(int msec); + void resetCursorBlinkTimer(); QString cancelText() const { return m_cancelText; } void setCancelText(const QString &text) { m_cancelText = text; } |