diff options
author | David Faure <david.faure@kdab.com> | 2019-07-29 14:27:16 +0200 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2019-07-29 17:15:02 +0200 |
commit | 3e7463411e549100eee7abe2a8fae16fd965f8f6 (patch) | |
tree | b33fe886ccf71ce7a9d32c323b78dbf00cde1bc1 /qmake | |
parent | f53fc76060e4eb5eeec28318946db9cc2bcfaca6 (diff) |
Fix crash when the focus widget gets a focus proxy after the fact
QApplicationPrivate::focus_widget became a dangling pointer
in the following scenario:
A widget first gets focus and later on gets a focus proxy.
QApplicationPrivate::focus_widget was still pointing to the initial widget.
Upon destruction, QWidget::hasFocus() [which follows to the focus proxy
and then compares with focus_widget] was therefore false for both
widgets. So QWidget::clearFocus() didn't call
QApplicationPrivate::setFocusWidget(0) for either of them. As a
result, focus_widget remained set, and became dangling.
In real life, this happened with a QWebEngineView, which the application
gave focus to upon creation. At that time it doesn't have a focus proxy
yet. That happens later, in QWebEngineViewPrivate::widgetChanged.
https://bugs.kde.org/show_bug.cgi?id=381793
Change-Id: Ifee610bb76a2d4d2797b98ece9bffe5fffe3c6a6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'qmake')
0 files changed, 0 insertions, 0 deletions