qt5base-lts/tests/auto
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
..
android Updated license headers 2016-01-21 18:55:18 +00:00
bic/data Binary compatibility files for QtBase (5.8.0) 2017-02-14 12:42:20 +00:00
cmake tests: Unify license to GPL-EXCEPT 2017-04-03 07:18:46 +00:00
compilerwarnings/data Updated license headers 2016-01-21 18:55:18 +00:00
concurrent Adapt to the C++ SIC introduced by P0012: noexcept overloading 2017-02-17 13:57:30 +00:00
corelib Fix autotest not to open too many files on a Unix 2017-05-29 06:46:50 +00:00
dbus Add Q_FALLTHROUGH to QtDBus tests 2017-05-17 16:16:02 +00:00
gui Fix painterpath rect intersections with points on the rect 2017-05-17 11:56:46 +00:00
guiapplauncher Fix path to examples part of tst_GuiAppLauncher 2015-02-13 07:28:15 +00:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network tst_qudpsocket: Blacklist "utun" interfaces on Darwin 2017-05-29 17:03:41 +00:00
opengl Switch to RGB(A|X)8888[_Premultiplied] for QOpenGLFBO readbacks on GLES 2017-03-28 11:17:52 +00:00
other Enable tst_qaccessibilitymac 2017-05-04 11:18:14 +00:00
printsupport Drop unnecessary dependencies from some tests 2017-01-10 16:34:52 +00:00
shared Make self-contained test of condensed font matching and width 2016-10-16 00:11:13 +00:00
sql Stabilize tst_QSqlThread::readWriteThreading 2017-05-18 21:18:02 +00:00
testlib Fix tst_Selftest on QEMU 2017-03-31 07:09:46 +00:00
tools Preserve last modification timestamps of installed files 2017-04-12 15:50:51 +00:00
widgets QWidgetWindow: don't give focus to windows that are being destroyed 2017-05-30 10:49:36 +00:00
xml Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-01 06:02:55 +01:00
auto.pro Build examples and tests only if their requirements are met 2017-03-22 15:55:55 +00:00
network-settings.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-06 15:36:44 +02:00