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>
This commit is contained in:
Eike Ziller
2019-01-18 16:33:40 +01:00
committed by Thomas Hartmann
parent de076eb889
commit d8920f923f

View File

@@ -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