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)
|
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>"
|
||||||
|
Loading…
Reference in New Issue
Block a user