aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpaster
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-06-02 09:10:40 +0200
committerEike Ziller <eike.ziller@qt.io>2020-06-02 11:44:53 +0000
commit5b364de1685e5bee5953e23da2552b5db4455a74 (patch)
tree13f505553880048143feea6678dbd09e31558599 /src/plugins/cpaster
parent26d46fc19dccb3b599dcd24f2a3701b7c4e25d2b (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/cpaster')
-rw-r--r--src/plugins/cpaster/protocol.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/cpaster/protocol.cpp b/src/plugins/cpaster/protocol.cpp
index b2b1e73792..b2ffc75b46 100644
--- a/src/plugins/cpaster/protocol.cpp
+++ b/src/plugins/cpaster/protocol.cpp
@@ -159,7 +159,7 @@ bool Protocol::showConfigurationError(const Protocol *p,
showConfig = false;
if (!parent)
- parent = Core::ICore::mainWindow();
+ parent = Core::ICore::dialogParent();
const QString title = tr("%1 - Configuration Error").arg(p->name());
QMessageBox mb(QMessageBox::Warning, title, message, QMessageBox::Cancel, parent);
QPushButton *settingsButton = nullptr;
@@ -220,7 +220,7 @@ bool NetworkProtocol::httpStatus(QString url, QString *errorMessage, bool useHtt
tr("Checking connection"),
tr("Connecting to %1...").arg(url),
QMessageBox::Cancel,
- Core::ICore::mainWindow());
+ Core::ICore::dialogParent());
connect(reply.data(), &QNetworkReply::finished, &box, &QWidget::close);
QApplication::setOverrideCursor(Qt::WaitCursor);
box.exec();