Fix QTimer with negative interval in QWidgetLineControl::setCursorBlinkPeriod
When keyboard blink is disabled, msec will be negative (-2 in my case). In that case if (msec) will evaluate to true and create a QTimer with a negative interval. Fix is to check for msec > 0. Change-Id: I5c8d82c3cdaf26a961c986f4164805aacfe3ae37 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
This commit is contained in:
parent
16dccb24e4
commit
a6ec09d7ed
@ -1472,7 +1472,7 @@ void QWidgetLineControl::setCursorBlinkPeriod(int msec)
|
|||||||
if (m_blinkTimer) {
|
if (m_blinkTimer) {
|
||||||
killTimer(m_blinkTimer);
|
killTimer(m_blinkTimer);
|
||||||
}
|
}
|
||||||
if (msec && !m_readOnly) {
|
if (msec > 0 && !m_readOnly) {
|
||||||
m_blinkTimer = startTimer(msec / 2);
|
m_blinkTimer = startTimer(msec / 2);
|
||||||
m_blinkStatus = 1;
|
m_blinkStatus = 1;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user