def _setup_ui(self): vbox = QtGui.QVBoxLayout(self) self.setLayout(vbox) grid = QtGui.QGridLayout() self.form = MAXForm(withButtons=False) grid.addWidget(self.form, 0, 0, 2, 1) # rescale taurus form methode self.form.scrollArea.sizeHint = self.scaleSize self.status_label = StatusArea() grid.addWidget(self.status_label, 0, 1, 1, 1) commandbox = QtGui.QVBoxLayout(self) self.start_button = TaurusCommandButton(command="StartCycle") self.start_button.setUseParentModel(True) self.stop_button = TaurusCommandButton(command="StopCycle") self.stop_button.setUseParentModel(True) commandbox.addWidget(self.start_button) commandbox.addWidget(self.stop_button) grid.addLayout(commandbox, 1, 1, 1, 1) vbox.addLayout(grid) self.trend = TaurusTrend() vbox.addWidget(self.trend, stretch=1) self.trend_trigger.connect(self.set_trend_paused) self.cyclingState = None
def _setup_ui(self): grid = QtGui.QGridLayout(self) self.setLayout(grid) grid.addWidget(QtGui.QLabel("Device:"), 0, 0) self.devicename_label = QtGui.QLabel("<devicename>") self.devicename_label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse) grid.addWidget(self.devicename_label, 0, 1) grid.addWidget(QtGui.QLabel("State:"), 1, 0) hbox = QtGui.QHBoxLayout(self) # self.state_led = TaurusLed() # hbox.addWidget(self.state_led) self.state_label = TaurusLabel() policy = QtGui.QSizePolicy() self.state_label.setBgRole("state") policy.setHorizontalPolicy(QtGui.QSizePolicy.Expanding) self.state_label.setSizePolicy(policy) hbox.addWidget(self.state_label) # hbox.insertStretch(2, 1) grid.addLayout(hbox, 1, 1, alignment=QtCore.Qt.AlignLeft) grid.setColumnStretch(1, 1)