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/python/pythonproject.cpp | |
parent | 26d46fc19dccb3b599dcd24f2a3701b7c4e25d2b (diff) | |
download | qt-creator-5b364de1685e5bee5953e23da2552b5db4455a74.tar.gz |
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/python/pythonproject.cpp')
-rw-r--r-- | src/plugins/python/pythonproject.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index d74bedea0e..3c3b225de9 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -257,12 +257,12 @@ bool PythonBuildSystem::saveRawList(const QStringList &rawList, const QString &f FileSaver saver(fileName, QIODevice::ReadOnly | QIODevice::Text); if (!saver.hasError()) { QString content = QTextStream(saver.file()).readAll(); - if (saver.finalize(ICore::mainWindow())) { + if (saver.finalize(ICore::dialogParent())) { QString errorMessage; result = writePyProjectFile(fileName, content, rawList, &errorMessage); if (!errorMessage.isEmpty()) MessageManager::write(errorMessage); - } + } } } else { // Old project file FileSaver saver(fileName, QIODevice::WriteOnly | QIODevice::Text); @@ -271,7 +271,7 @@ bool PythonBuildSystem::saveRawList(const QStringList &rawList, const QString &f for (const QString &filePath : rawList) stream << filePath << '\n'; saver.setResult(&stream); - result = saver.finalize(ICore::mainWindow()); + result = saver.finalize(ICore::dialogParent()); } } |