moninj: DAC horizontal layout

This commit is contained in:
Simon Renblad 2024-04-17 14:39:04 +08:00
parent d6c396fc69
commit b5e762854b

View File

@ -355,21 +355,16 @@ class _DACWidget(QtWidgets.QFrame):
self.setFrameShadow(QtWidgets.QFrame.Raised) self.setFrameShadow(QtWidgets.QFrame.Raised)
grid = QtWidgets.QGridLayout() grid = QtWidgets.QGridLayout()
grid.setContentsMargins(0, 0, 0, 0) grid.setContentsMargins(2, 2, 2, 2)
grid.setHorizontalSpacing(0) grid.setHorizontalSpacing(2)
grid.setVerticalSpacing(0)
self.setLayout(grid) self.setLayout(grid)
label = QtWidgets.QLabel("{} ch{}".format(title, channel)) label = QtWidgets.QLabel("{} ch{}".format(title, channel))
label.setAlignment(QtCore.Qt.AlignCenter) label.setAlignment(QtCore.Qt.AlignLeft)
grid.addWidget(label, 1, 1) grid.addWidget(label, 0, 1)
self.value = QtWidgets.QLabel() self.value = QtWidgets.QLabel()
self.value.setAlignment(QtCore.Qt.AlignCenter) self.value.setAlignment(QtCore.Qt.AlignRight)
grid.addWidget(self.value, 2, 1, 6, 1) grid.addWidget(self.value, 0, 2, 1, 1)
grid.setRowStretch(1, 1)
grid.setRowStretch(2, 0)
grid.setRowStretch(3, 1)
def set_value(self, value): def set_value(self, value):
self.value.setText("<font size=\"4\">{:.3f}</font><font size=\"2\"> %</font>" self.value.setText("<font size=\"4\">{:.3f}</font><font size=\"2\"> %</font>"