forked from M-Labs/artiq
1
0
Fork 0

moninj: add LayoutWidget

This commit is contained in:
Simon Renblad 2024-04-16 14:14:44 +08:00
parent b4fb9b9bc6
commit 2a16b84df9
1 changed files with 9 additions and 10 deletions

View File

@ -792,21 +792,20 @@ class _MonInjDock(QtWidgets.QDockWidget):
self.setObjectName(name)
self.setFeatures(QtWidgets.QDockWidget.DockWidgetMovable |
QtWidgets.QDockWidget.DockWidgetFloatable)
def layout_widgets(self, handlers):
layout = LayoutWidget()
self.setWidget(layout)
scroll_area = QtWidgets.QScrollArea()
self.setWidget(scroll_area)
grid = FlowLayout()
layout.addWidget(scroll_area)
self.grid = FlowLayout()
grid_widget = QtWidgets.QWidget()
grid_widget.setLayout(grid)
for handler in sorted(handlers, key=lambda h: h.sort_key()):
grid.addWidget(handler.widget)
grid_widget.setLayout(self.grid)
scroll_area.setWidgetResizable(True)
scroll_area.setWidget(grid_widget)
def layout_widgets(self, handlers):
for handler in sorted(handlers, key=lambda h: h.sort_key()):
self.grid.addWidget(handler.widget)
class MonInj:
def __init__(self, schedule_ctl):