forked from M-Labs/artiq
1
0
Fork 0

moninj: DAC horizontal layout

This commit is contained in:
Simon Renblad 2024-04-17 14:39:04 +08:00
parent d6c396fc69
commit b5e762854b
1 changed files with 6 additions and 11 deletions

View File

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