Fix focusObjectDuringDestruction crash
Don’t assume that there is an active modal widget on QApplication::focusChanged(). That signal can also be emitted on focus clear during dialog destruction. Task-number: QTBUG-66536 Change-Id: I20c64339c56a52b39c26a7683b62779deba576d9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>bb10
parent
eba1d56fad
commit
dd96a62fca
|
|
@ -1521,7 +1521,8 @@ public:
|
|||
const QWindow *window = QGuiApplication::topLevelWindows().constFirst();
|
||||
|
||||
const QFileDialog *fileDialog = qobject_cast<QFileDialog*>(QApplication::activeModalWidget());
|
||||
QVERIFY(fileDialog);
|
||||
if (!fileDialog)
|
||||
return;
|
||||
|
||||
// The problem in QTBUG-57193 was from a platform input context plugin that was
|
||||
// connected to QWindow::focusObjectChanged(), and consequently accessed the focus
|
||||
|
|
|
|||
Loading…
Reference in New Issue