forked from M-Labs/artiq
1
0
Fork 0

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.
This commit is contained in:
David Nadlinger 2023-09-14 23:15:24 +01:00 committed by Sébastien Bourdeauducq
parent 9fbd6de30c
commit 5dd2f7c4e8
3 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ class AppletsCCBDock(applets.AppletsDock):
sep.setSeparator(True) sep.setSeparator(True)
self.table.addAction(sep) self.table.addAction(sep)
ccbp_group_menu = QtWidgets.QMenu() ccbp_group_menu = QtWidgets.QMenu(self.table)
actiongroup = QtGui.QActionGroup(self.table) actiongroup = QtGui.QActionGroup(self.table)
actiongroup.setExclusive(True) actiongroup.setExclusive(True)
self.ccbp_group_none = QtGui.QAction("No policy", self.table) 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.table.itemSelectionChanged.connect(self.update_group_ccbp_menu)
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 = QtGui.QActionGroup(self.table)
actiongroup.setExclusive(True) actiongroup.setExclusive(True)
self.ccbp_global_ignore = QtGui.QAction("Ignore requests", self.table) self.ccbp_global_ignore = QtGui.QAction("Ignore requests", self.table)

View File

@ -232,7 +232,7 @@ class ExplorerDock(QtWidgets.QDockWidget):
reqterm_action.setShortcutContext(QtCore.Qt.ShortcutContext.WidgetShortcut) reqterm_action.setShortcutContext(QtCore.Qt.ShortcutContext.WidgetShortcut)
self.el.addAction(reqterm_action) self.el.addAction(reqterm_action)
set_shortcut_menu = QtWidgets.QMenu() set_shortcut_menu = QtWidgets.QMenu(self.el)
for i in range(12): for i in range(12):
action = QtGui.QAction("F" + str(i+1), self.el) action = QtGui.QAction("F" + str(i+1), self.el)
action.triggered.connect(partial(self.set_shortcut, i)) action.triggered.connect(partial(self.set_shortcut, i))

View File

@ -458,7 +458,7 @@ class AppletsDock(QtWidgets.QDockWidget):
new_action = QtGui.QAction("New applet", self.table) new_action = QtGui.QAction("New applet", self.table)
new_action.triggered.connect(partial(self.new_with_parent, self.new)) new_action.triggered.connect(partial(self.new_with_parent, self.new))
self.table.addAction(new_action) self.table.addAction(new_action)
templates_menu = QtWidgets.QMenu() templates_menu = QtWidgets.QMenu(self.table)
for name, template in _templates: for name, template in _templates:
spec = {"ty": "command", "command": template} spec = {"ty": "command", "command": template}
action = QtGui.QAction(name, self.table) action = QtGui.QAction(name, self.table)