forked from M-Labs/artiq
moninj: DAC horizontal layout
This commit is contained in:
parent
d6c396fc69
commit
b5e762854b
|
@ -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>"
|
||||
|
|
Loading…
Reference in New Issue