forked from M-Labs/artiq
moninj: dock add layoutwidget
This commit is contained in:
parent
2fde21152a
commit
9fc4cdea6b
|
@ -741,21 +741,21 @@ class _MonInjDock(QtWidgets.QDockWidget):
|
||||||
self.setObjectName(name)
|
self.setObjectName(name)
|
||||||
self.setFeatures(QtWidgets.QDockWidget.DockWidgetMovable |
|
self.setFeatures(QtWidgets.QDockWidget.DockWidgetMovable |
|
||||||
QtWidgets.QDockWidget.DockWidgetFloatable)
|
QtWidgets.QDockWidget.DockWidgetFloatable)
|
||||||
|
grid = LayoutWidget()
|
||||||
|
self.setWidget(grid)
|
||||||
|
|
||||||
def layout_widgets(self, widgets):
|
|
||||||
scroll_area = QtWidgets.QScrollArea()
|
scroll_area = QtWidgets.QScrollArea()
|
||||||
self.setWidget(scroll_area)
|
grid.addWidget(scroll_area, 0, 0)
|
||||||
|
self.flow = FlowLayout()
|
||||||
grid = FlowLayout()
|
|
||||||
grid_widget = QtWidgets.QWidget()
|
grid_widget = QtWidgets.QWidget()
|
||||||
grid_widget.setLayout(grid)
|
grid_widget.setLayout(self.flow)
|
||||||
|
|
||||||
for widget in sorted(widgets, key=lambda w: w.sort_key()):
|
|
||||||
grid.addWidget(widget)
|
|
||||||
|
|
||||||
scroll_area.setWidgetResizable(True)
|
scroll_area.setWidgetResizable(True)
|
||||||
scroll_area.setWidget(grid_widget)
|
scroll_area.setWidget(grid_widget)
|
||||||
|
|
||||||
|
def layout_widgets(self, widgets):
|
||||||
|
for widget in sorted(widgets, key=lambda w: w.sort_key()):
|
||||||
|
self.flow.addWidget(widget)
|
||||||
|
|
||||||
|
|
||||||
class MonInj:
|
class MonInj:
|
||||||
def __init__(self, schedule_ctl):
|
def __init__(self, schedule_ctl):
|
||||||
|
|
Loading…
Reference in New Issue