forked from M-Labs/artiq
1
0
Fork 0

moninj: change to vboxlayout

This commit is contained in:
Simon Renblad 2024-04-17 13:18:38 +08:00
parent 2d8a3d14a6
commit 5ad4199668
1 changed files with 5 additions and 2 deletions

View File

@ -8,7 +8,6 @@ from PyQt5 import QtCore, QtWidgets
from artiq.coredevice.comm_moninj import CommMonInj, TTLOverride, TTLProbe from artiq.coredevice.comm_moninj import CommMonInj, TTLOverride, TTLProbe
from artiq.coredevice.ad9912_reg import AD9912_SER_CONF from artiq.coredevice.ad9912_reg import AD9912_SER_CONF
from artiq.gui.tools import LayoutWidget from artiq.gui.tools import LayoutWidget
from artiq.gui.flowlayout import FlowLayout
from artiq.gui.models import DictSyncTreeSepModel from artiq.gui.models import DictSyncTreeSepModel
@ -856,15 +855,19 @@ class MonInjDock(QtWidgets.QDockWidget):
layout.addWidget(add_channel_btn, 0, 0, colspan=1) layout.addWidget(add_channel_btn, 0, 0, colspan=1)
scroll_area = QtWidgets.QScrollArea() scroll_area = QtWidgets.QScrollArea()
layout.addWidget(scroll_area, 1, 0, colspan=10) layout.addWidget(scroll_area, 1, 0, colspan=10)
self.grid = FlowLayout() self.grid = QtWidgets.QVBoxLayout()
self.spacer = QtWidgets.QSpacerItem(50, 500, QtWidgets.QSizePolicy.Ignored,
QtWidgets.QSizePolicy.Fixed)
grid_widget = QtWidgets.QWidget() grid_widget = QtWidgets.QWidget()
grid_widget.setLayout(self.grid) grid_widget.setLayout(self.grid)
scroll_area.setWidgetResizable(True) scroll_area.setWidgetResizable(True)
scroll_area.setWidget(grid_widget) scroll_area.setWidget(grid_widget)
def layout_widgets(self, handlers): def layout_widgets(self, handlers):
self.grid.removeItem(self.spacer)
for handler in handlers: for handler in handlers:
self.grid.addWidget(handler.widget) self.grid.addWidget(handler.widget)
self.grid.insertItem(-1, self.spacer)
def set_channels(self, handlers): def set_channels(self, handlers):
self._channel_model.update(handlers) self._channel_model.update(handlers)