QLineEdit: disable cursor blinking on hide
QLineEdit activates the blinking cursor timer when it's shown, but never deactivates it, resulting in constant wakeups even for hidden line edits. Note that this is a workaround. Qt is supposed to send a focus out event to line edits that get hidden. In some corner cases, it doesn't, and only a hide event is sent. Change-Id: Ic0645512051466ca9b1e84c54cef34c22287338b Task-number: QTBUG-52021 Pick-to: 6.7 6.6 6.5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>bb10
parent
e26fbd59d5
commit
e35dcba5bb
|
|
@ -1462,6 +1462,8 @@ bool QLineEdit::event(QEvent * e)
|
|||
|| style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, this))
|
||||
d->setCursorVisible(true);
|
||||
}
|
||||
} else if (e->type() == QEvent::Hide) {
|
||||
d->control->setBlinkingCursorEnabled(false);
|
||||
#if QT_CONFIG(action)
|
||||
} else if (e->type() == QEvent::ActionRemoved) {
|
||||
d->removeAction(static_cast<QActionEvent *>(e)->action());
|
||||
|
|
|
|||
Loading…
Reference in New Issue