From 9fc4cdea6bb4ceb0114816b5c6a98cd8f2148597 Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Thu, 2 May 2024 14:43:42 +0800 Subject: [PATCH] moninj: dock add layoutwidget --- artiq/dashboard/moninj.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/artiq/dashboard/moninj.py b/artiq/dashboard/moninj.py index eba6024e1..b7cf182cd 100644 --- a/artiq/dashboard/moninj.py +++ b/artiq/dashboard/moninj.py @@ -741,21 +741,21 @@ class _MonInjDock(QtWidgets.QDockWidget): self.setObjectName(name) self.setFeatures(QtWidgets.QDockWidget.DockWidgetMovable | QtWidgets.QDockWidget.DockWidgetFloatable) + grid = LayoutWidget() + self.setWidget(grid) - def layout_widgets(self, widgets): scroll_area = QtWidgets.QScrollArea() - self.setWidget(scroll_area) - - grid = FlowLayout() + grid.addWidget(scroll_area, 0, 0) + self.flow = FlowLayout() grid_widget = QtWidgets.QWidget() - grid_widget.setLayout(grid) - - for widget in sorted(widgets, key=lambda w: w.sort_key()): - grid.addWidget(widget) - + grid_widget.setLayout(self.flow) scroll_area.setWidgetResizable(True) 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: def __init__(self, schedule_ctl):