forked from qt-creator/qt-creator
Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly. Especially for modal dialogs, using dialogParent() is important, since that guarantees the stacking order in case of other dialogs currently being open. Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -404,7 +404,7 @@ void QmlEngine::connectionStartupFailed()
|
||||
return;
|
||||
}
|
||||
|
||||
auto infoBox = new QMessageBox(ICore::mainWindow());
|
||||
auto infoBox = new QMessageBox(ICore::dialogParent());
|
||||
infoBox->setIcon(QMessageBox::Critical);
|
||||
infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME);
|
||||
infoBox->setText(tr("Could not connect to the in-process QML debugger."
|
||||
@@ -425,7 +425,7 @@ void QmlEngine::appStartupFailed(const QString &errorMessage)
|
||||
QString error = tr("Could not connect to the in-process QML debugger. %1").arg(errorMessage);
|
||||
|
||||
if (companionEngine()) {
|
||||
auto infoBox = new QMessageBox(ICore::mainWindow());
|
||||
auto infoBox = new QMessageBox(ICore::dialogParent());
|
||||
infoBox->setIcon(QMessageBox::Critical);
|
||||
infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME);
|
||||
infoBox->setText(error);
|
||||
|
||||
Reference in New Issue
Block a user