diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-06-02 09:10:40 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-06-02 11:44:53 +0000 |
commit | 5b364de1685e5bee5953e23da2552b5db4455a74 (patch) | |
tree | 13f505553880048143feea6678dbd09e31558599 /src/plugins/qmlprofiler | |
parent | 26d46fc19dccb3b599dcd24f2a3701b7c4e25d2b (diff) |
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>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertool.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 274935b8a4..bbd77dae27 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -351,7 +351,7 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker) connect(d->m_profilerConnections, &QmlProfilerClientManager::connectionFailed, runWorker, [this, runWorker]() { - auto infoBox = new QMessageBox(ICore::mainWindow()); + auto infoBox = new QMessageBox(ICore::dialogParent()); infoBox->setIcon(QMessageBox::Critical); infoBox->setWindowTitle(Core::Constants::IDE_DISPLAY_NAME); @@ -580,7 +580,7 @@ void QmlProfilerTool::logError(const QString &msg) void QmlProfilerTool::showErrorDialog(const QString &error) { - auto errorDialog = new QMessageBox(ICore::mainWindow()); + auto errorDialog = new QMessageBox(ICore::dialogParent()); errorDialog->setIcon(QMessageBox::Warning); errorDialog->setWindowTitle(tr("QML Profiler")); errorDialog->setText(error); @@ -604,7 +604,7 @@ void QmlProfilerTool::showSaveDialog() QLatin1String tFile(QtdFileExtension); QLatin1String zFile(QztFileExtension); QString filename = QFileDialog::getSaveFileName( - ICore::mainWindow(), tr("Save QML Trace"), + ICore::dialogParent(), tr("Save QML Trace"), QmlProfilerPlugin::globalSettings()->lastTraceFile(), tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile)); if (!filename.isEmpty()) { @@ -628,7 +628,7 @@ void QmlProfilerTool::showLoadDialog() QLatin1String tFile(QtdFileExtension); QLatin1String zFile(QztFileExtension); QString filename = QFileDialog::getOpenFileName( - ICore::mainWindow(), tr("Load QML Trace"), + ICore::dialogParent(), tr("Load QML Trace"), QmlProfilerPlugin::globalSettings()->lastTraceFile(), tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile)); @@ -773,7 +773,7 @@ QList <QAction *> QmlProfilerTool::profilerContextMenuActions() void QmlProfilerTool::showNonmodalWarning(const QString &warningMsg) { - auto noExecWarning = new QMessageBox(ICore::mainWindow()); + auto noExecWarning = new QMessageBox(ICore::dialogParent()); noExecWarning->setIcon(QMessageBox::Warning); noExecWarning->setWindowTitle(tr("QML Profiler")); noExecWarning->setText(warningMsg); |