diff --git a/mslib/msui/mscolab.py b/mslib/msui/mscolab.py index e3905d918..53bc28841 100644 --- a/mslib/msui/mscolab.py +++ b/mslib/msui/mscolab.py @@ -519,7 +519,7 @@ def __init__(self, parent=None, data_dir=None): self.ui.serverOptionsCb.currentIndexChanged.connect(self.server_options_handler) # set up user menu and add to toolbutton - self.user_menu = QtWidgets.QMenu() + self.user_menu = QtWidgets.QMenu(self.ui) self.profile_action = self.user_menu.addAction("Profile", self.open_profile_window) self.user_menu.addSeparator() self.logout_action = self.user_menu.addAction("Logout", self.logout) @@ -790,7 +790,7 @@ def open_profile_window(self): def on_context_menu(point): self.gravatar_menu.exec_(self.profile_dialog.gravatarLabel.mapToGlobal(point)) - self.prof_diag = QtWidgets.QDialog() + self.prof_diag = QtWidgets.QDialog(self.ui) self.profile_dialog = ui_profile.Ui_ProfileWindow() self.profile_dialog.setupUi(self.prof_diag) self.profile_dialog.buttonBox.accepted.connect(lambda: self.prof_diag.close()) @@ -800,7 +800,7 @@ def on_context_menu(point): self.profile_dialog.deleteAccountBtn.clicked.connect(self.delete_account) # add context menu for right click on image - self.gravatar_menu = QtWidgets.QMenu() + self.gravatar_menu = QtWidgets.QMenu(self.ui) self.gravatar_menu.addAction('Fetch Gravatar', lambda: self.fetch_gravatar(refresh=True)) self.gravatar_menu.addAction('Remove Gravatar', lambda: self.remove_gravatar()) self.profile_dialog.gravatarLabel.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) @@ -870,7 +870,7 @@ def browse(): self.add_proj_dialog.f_content = file_content self.add_proj_dialog.selectedFile.setText(file_name) - self.proj_diag = QtWidgets.QDialog() + self.proj_diag = QtWidgets.QDialog(self.ui) self.add_proj_dialog = add_operation_ui.Ui_addOperationDialog() self.add_proj_dialog.setupUi(self.proj_diag) self.add_proj_dialog.f_content = None diff --git a/mslib/msui/wms_control.py b/mslib/msui/wms_control.py index a01af591f..41294cb56 100644 --- a/mslib/msui/wms_control.py +++ b/mslib/msui/wms_control.py @@ -512,13 +512,13 @@ def __init__(self, parent=None, default_WMS=None, wms_cache=None, view=None): # Progress dialog to inform the user about image ongoing retrievals. self.pdlg = QtWidgets.QProgressDialog( - "retrieving image...", "Cancel", 0, 10, parent=self.parent()) + "retrieving image...", "Cancel", 0, 10, parent=self) self.pdlg.close() # Progress dialog to inform the user about ongoing capability requests. self.capabilities_worker = Worker(None) self.cpdlg = QtWidgets.QProgressDialog( - "retrieving wms capabilities...", "Cancel", 0, 10, parent=self.multilayers) + "retrieving wms capabilities...", "Cancel", 0, 10, parent=self) self.cpdlg.canceled.connect(self.stop_capabilities_retrieval) self.cpdlg.close() diff --git a/mslib/support/qt_json_view/view.py b/mslib/support/qt_json_view/view.py index 12415f926..72f569f77 100644 --- a/mslib/support/qt_json_view/view.py +++ b/mslib/support/qt_json_view/view.py @@ -17,7 +17,7 @@ def __init__(self, parent=None): def _menu(self, position): """Show the actions of the DataType (if any).""" - menu = QtWidgets.QMenu() + menu = QtWidgets.QMenu(self) index = self.indexAt(position) data = index.data(TypeRole) if data is None: