qt5base-lts/tests/auto/widgets
Mitch Curtis c25ad981a3 QWidgetWindow: don't give focus to windows that are being destroyed
In the referenced bug report, dismissing a QFileDialog while the
Qt Virtual Keyboard was in use would result in a crash.

Dismissing a file dialog created with
e.g. QFileDialog::getOpenFileName() causes it to eventually be
destroyed. When this happens, it starts deleting its children. Each
child widget's destructor calls clearFocus(). In clearFocus(), there is
a block of code that emits QWindow::focusChanged(), passing the result
of focusObject() called on that widget's window.
QWidgetWindow::focusObject() could end up using itself as a fallback
focus object if it had no other focus objects (e.g. children) to use
instead, even though it was in the process of being destroyed; as were
all of its children. The Qt Virtual Keyboard plugin would then try to
use the focus object, even though it was in an invalid state.

To fix this problem, we return early from QWidgetWindow::focusObject()
if the window is in the process of being destroyed.

Task-number: QTBUG-57193
Change-Id: I137cf9415812ce2e0419c0afe8076ce150f248cb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-05-30 10:49:36 +00:00
..
dialogs QWidgetWindow: don't give focus to windows that are being destroyed 2017-05-30 10:49:36 +00:00
effects QWidgetEffectSourcePrivate::draw(): Call render() when no shared painter exists 2017-05-29 10:23:01 +00:00
gestures autotests: use QTest::createTouchDevice() 2016-06-10 13:07:17 +00:00
graphicsview Blacklist tst_QGraphicsScene::removeItem on OS X 10.11 in CI 2017-05-11 10:32:38 +00:00
itemviews Fix tst_QDirModel for qemu 2017-04-07 05:53:47 +00:00
kernel Fix tst_QWidget::translucentWidget() on high DPI displays 2017-05-29 10:35:46 +00:00
styles tests/auto/widgets: use QCOMPARE(., nullptr) 2016-11-30 07:24:47 +00:00
util Merge remote-tracking branch 'origin/5.8' into 5.9 2017-03-13 15:55:44 +01:00
widgets Skip failing autotests with b2qt toolchain 2017-05-09 08:11:18 +00:00
widgets.pro Add autotest for QGestureRecognizer. 2014-10-23 21:11:28 +02:00