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:
@@ -55,6 +55,7 @@
|
||||
#include <Gui/CommandT.h>
|
||||
#include <Gui/Control.h>
|
||||
#include <Gui/MDIView.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/SoFCCSysDragger.h>
|
||||
#include <Gui/View3DInventor.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
@@ -191,7 +192,7 @@ bool ViewProviderAssembly::canDragObjectToTarget(App::DocumentObject* obj,
|
||||
if (obj == obj1 || obj == obj2 || obj == part1 || obj == part2 || obj == obj3) {
|
||||
if (!prompted) {
|
||||
prompted = true;
|
||||
QMessageBox msgBox;
|
||||
QMessageBox msgBox(Gui::getMainWindow());
|
||||
msgBox.setText(tr("The object is associated to one or more joints."));
|
||||
msgBox.setInformativeText(
|
||||
tr("Do you want to move the object and delete associated joints?"));
|
||||
|
||||
Reference in New Issue
Block a user