QKeySequenceEdit: Finish editing when losing focus
Do not wait for the timer to time out. When losing the focus, finish editing immediately since we cannot really edit it further without focus. Change-Id: If42926ef9b06fbea7592a294f48ea5e99ef57ef8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b6a953bb939cb5fe6305f4acf62003c766887f51) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
a387208e9c
commit
a4a9a46964
@ -323,6 +323,16 @@ void QKeySequenceEdit::timerEvent(QTimerEvent *e)
|
||||
QWidget::timerEvent(e);
|
||||
}
|
||||
|
||||
/*!
|
||||
\reimp
|
||||
*/
|
||||
void QKeySequenceEdit::focusOutEvent(QFocusEvent *e)
|
||||
{
|
||||
Q_D(QKeySequenceEdit);
|
||||
d->finishEditing();
|
||||
QWidget::focusOutEvent(e);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qkeysequenceedit.cpp"
|
||||
|
@ -45,6 +45,7 @@ protected:
|
||||
void keyPressEvent(QKeyEvent *) override;
|
||||
void keyReleaseEvent(QKeyEvent *) override;
|
||||
void timerEvent(QTimerEvent *) override;
|
||||
void focusOutEvent(QFocusEvent *) override;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QKeySequenceEdit)
|
||||
|
Loading…
x
Reference in New Issue
Block a user