From 9073a38e2ad3342291e9b2e68cf120a2faba06b0 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 25 Nov 2009 10:01:23 +0100 Subject: Make sure the cursor of the lineedit doesn't blink when a key is pressed This was a regression against 4.5 Task-number: QTBUG-4944 Reviewed-by: ogoffart --- src/gui/widgets/qlineedit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 3800224..785b2bd 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1411,6 +1411,8 @@ bool QLineEdit::event(QEvent * e) QTimer::singleShot(0, this, SLOT(_q_handleWindowActivate())); }else if(e->type() == QEvent::ShortcutOverride){ d->control->processEvent(e); + } else if (e->type() == QEvent::KeyRelease) { + d->control->setCursorBlinkPeriod(QApplication::cursorFlashTime()); } #ifdef QT_KEYPAD_NAVIGATION @@ -1615,6 +1617,8 @@ void QLineEdit::keyPressEvent(QKeyEvent *event) } #endif d->control->processKeyEvent(event); + if (event->isAccepted()) + d->control->setCursorBlinkPeriod(0); } /*! -- cgit v0.12