Add missing parent for messagebox and other popups

Unparented popups can easily get lost in backround, but they still block top level event loop when run with ::exec() thus preventing interactions with main window.  This mainly happens on wayland. Setting the parent ensures they are always kept on top and reasonably positioned.
This commit is contained in:
Karliss
2025-03-13 12:00:17 +02:00
committed by Chris Hennes
parent ba2a377e7e
commit fa61131590
22 changed files with 33 additions and 24 deletions

View File

@@ -30,6 +30,7 @@
#include <App/Document.h>
#include <Gui/Application.h>
#include <Gui/Document.h>
#include <Gui/MainWindow.h>
#include <Gui/View3DInventor.h>
#include <Gui/ViewProviderDocumentObject.h>
@@ -96,7 +97,7 @@ const std::vector<QWidget*> &TaskDialog::getDialogContent() const
bool TaskDialog::canClose() const
{
QMessageBox msgBox;
QMessageBox msgBox(Gui::getMainWindow());
msgBox.setText(tr("A dialog is already open in the task panel"));
msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?"));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);