qt5base-lts/tests/auto/widgets
David Faure 3e7463411e 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>
2019-07-29 17:15:02 +02:00
..
dialogs Merge remote-tracking branch 'origin/5.12' into 5.13 2019-06-07 13:19:27 +02:00
effects qWaitFor: Prevent being stuck in QCoreApplication::processEvents 2019-01-09 18:10:54 +00:00
graphicsview Merge remote-tracking branch 'origin/5.12' into 5.13 2019-07-12 12:23:29 +02:00
itemviews Merge remote-tracking branch 'origin/5.12' into 5.13 2019-06-07 13:19:27 +02:00
kernel Fix crash when the focus widget gets a focus proxy after the fact 2019-07-29 17:15:02 +02:00
styles Merge remote-tracking branch 'origin/5.12' into 5.13 2019-04-16 09:34:50 +02:00
util Merge remote-tracking branch 'origin/5.12' into 5.13 2019-06-11 01:00:06 +02:00
widgets Merge remote-tracking branch 'origin/5.12' into 5.13 2019-06-25 15:47:42 +02:00
widgets.pro Move QGestureRecognizer test to widgets/kernel 2017-06-02 18:36:11 +00:00