From 5dd2f7c4e87b8b0011eb758caa78906c520a652c Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Thu, 14 Sep 2023 23:15:24 +0100 Subject: [PATCH] dashboard: Explicitly specify QMenu parents Not sure if this is a lifetime issue or something else, but without it, the respective submenu "triangles" would just not be shown in PyQt6. --- artiq/dashboard/applets_ccb.py | 4 ++-- artiq/dashboard/explorer.py | 2 +- artiq/gui/applets.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/artiq/dashboard/applets_ccb.py b/artiq/dashboard/applets_ccb.py index 5b8faa4c9..9b5dc900a 100644 --- a/artiq/dashboard/applets_ccb.py +++ b/artiq/dashboard/applets_ccb.py @@ -17,7 +17,7 @@ class AppletsCCBDock(applets.AppletsDock): sep.setSeparator(True) self.table.addAction(sep) - ccbp_group_menu = QtWidgets.QMenu() + ccbp_group_menu = QtWidgets.QMenu(self.table) actiongroup = QtGui.QActionGroup(self.table) actiongroup.setExclusive(True) self.ccbp_group_none = QtGui.QAction("No policy", self.table) @@ -47,7 +47,7 @@ class AppletsCCBDock(applets.AppletsDock): self.table.itemSelectionChanged.connect(self.update_group_ccbp_menu) self.update_group_ccbp_menu() - ccbp_global_menu = QtWidgets.QMenu() + ccbp_global_menu = QtWidgets.QMenu(self.table) actiongroup = QtGui.QActionGroup(self.table) actiongroup.setExclusive(True) self.ccbp_global_ignore = QtGui.QAction("Ignore requests", self.table) diff --git a/artiq/dashboard/explorer.py b/artiq/dashboard/explorer.py index f13358a31..de6f2100a 100644 --- a/artiq/dashboard/explorer.py +++ b/artiq/dashboard/explorer.py @@ -232,7 +232,7 @@ class ExplorerDock(QtWidgets.QDockWidget): reqterm_action.setShortcutContext(QtCore.Qt.ShortcutContext.WidgetShortcut) self.el.addAction(reqterm_action) - set_shortcut_menu = QtWidgets.QMenu() + set_shortcut_menu = QtWidgets.QMenu(self.el) for i in range(12): action = QtGui.QAction("F" + str(i+1), self.el) action.triggered.connect(partial(self.set_shortcut, i)) diff --git a/artiq/gui/applets.py b/artiq/gui/applets.py index 36e826a7d..37ccaf998 100644 --- a/artiq/gui/applets.py +++ b/artiq/gui/applets.py @@ -458,7 +458,7 @@ class AppletsDock(QtWidgets.QDockWidget): new_action = QtGui.QAction("New applet", self.table) new_action.triggered.connect(partial(self.new_with_parent, self.new)) self.table.addAction(new_action) - templates_menu = QtWidgets.QMenu() + templates_menu = QtWidgets.QMenu(self.table) for name, template in _templates: spec = {"ty": "command", "command": template} action = QtGui.QAction(name, self.table)