diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-01-18 16:33:40 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2019-01-18 16:30:15 +0000 |
commit | d8920f923faaf5b8ad827d03e637bad71af645c0 (patch) | |
tree | cb48c5e3d10f7cbde2c589ff6faf191bd231c5bd | |
parent | de076eb889db3a847f25f5c2ce8519f3d5a82fc3 (diff) | |
download | qt-creator-d8920f923faaf5b8ad827d03e637bad71af645c0.tar.gz |
Fix crash with reload prompt in presence of modal dialog
When a modal dialog is open, we delay the opening of the reload prompt,
which is good.
We should not directly open the reload prompt while processing a focus
change signal, because that will interfere too much with the focus
itself. Queue the signal processing.
Fixes: QDS-381
Change-Id: I8973aa986de5a46bf874529cbbda0b325222fcac
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r-- | src/plugins/coreplugin/documentmanager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index b054b7ccd1..ad1cb3f638 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -215,7 +215,12 @@ void DocumentManagerPrivate::onApplicationFocusChange() DocumentManagerPrivate::DocumentManagerPrivate() { - connect(qApp, &QApplication::focusChanged, this, &DocumentManagerPrivate::onApplicationFocusChange); + // we do not want to do too much directly in the focus change event, so queue the connection + connect(qApp, + &QApplication::focusChanged, + this, + &DocumentManagerPrivate::onApplicationFocusChange, + Qt::QueuedConnection); } } // namespace Internal |