moninj: change to vboxlayout

This commit is contained in:
Simon Renblad 2024-04-17 13:18:38 +08:00
parent d3308e551c
commit a7478a907c

View File

@ -8,7 +8,6 @@ from PyQt5 import QtCore, QtWidgets
from artiq.coredevice.comm_moninj import CommMonInj, TTLOverride, TTLProbe
from artiq.coredevice.ad9912_reg import AD9912_SER_CONF
from artiq.gui.tools import LayoutWidget
from artiq.gui.flowlayout import FlowLayout
from artiq.gui.models import DictSyncTreeSepModel
@ -840,15 +839,19 @@ class MonInjDock(QtWidgets.QDockWidget):
layout.addWidget(add_channel_btn, 0, 0, colspan=1)
scroll_area = QtWidgets.QScrollArea()
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.setLayout(self.grid)
scroll_area.setWidgetResizable(True)
scroll_area.setWidget(grid_widget)
def layout_widgets(self, handlers):
self.grid.removeItem(self.spacer)
for handler in handlers:
self.grid.addWidget(handler.widget)
self.grid.insertItem(-1, self.spacer)
def set_channels(self, handlers):
self._channel_model.clear()