def __init__(self, name): dockarea.Dock.__init__(self, name, size=(1500, 500)) self.grid = QtGui.QGridLayout() gridw = QtGui.QWidget() gridw.setLayout(self.grid) self.addWidget(gridw)
def __init__(self, dialog_parent, dock_area): dockarea.Dock.__init__(self, "Results", size=(1500, 500)) self.dialog_parent = dialog_parent self.dock_area = dock_area grid = LayoutWidget() self.addWidget(grid) self.table = QtGui.QTableView() self.table.setSelectionMode(QtGui.QAbstractItemView.NoSelection) self.table.horizontalHeader().setResizeMode( QtGui.QHeaderView.ResizeToContents) grid.addWidget(self.table, 0, 0) add_display_box = QtGui.QGroupBox("Add display") grid.addWidget(add_display_box, 0, 1) display_grid = QtGui.QGridLayout() add_display_box.setLayout(display_grid) for n, name in enumerate(display_types.keys()): btn = QtGui.QPushButton(name) display_grid.addWidget(btn, n, 0) btn.clicked.connect(partial(self.create_dialog, name)) self.displays = dict()
def __init__(self, channel, sysclk, title): self.channel = channel self.sysclk = sysclk QtGui.QFrame.__init__(self) self.setFrameShape(QtGui.QFrame.Panel) self.setFrameShadow(QtGui.QFrame.Raised) grid = QtGui.QGridLayout() self.setLayout(grid) label = QtGui.QLabel(title) label.setAlignment(QtCore.Qt.AlignCenter) label.setWordWrap(True) grid.addWidget(label, 1, 1) self._value = QtGui.QLabel() self._value.setAlignment(QtCore.Qt.AlignCenter) self._value.setWordWrap(True) grid.addWidget(self._value, 2, 1, 6, 1) grid.setRowStretch(1, 1) grid.setRowStretch(2, 0) grid.setRowStretch(3, 1) self.set_value(0)
def __init__(self, send_to_device, channel, force_out, name, comment): self.send_to_device = send_to_device self.channel = channel self.comment = comment self.force_out = force_out QtGui.QFrame.__init__(self) self.setFrameShape(QtGui.QFrame.Panel) self.setFrameShadow(QtGui.QFrame.Raised) grid = QtGui.QGridLayout() self.setLayout(grid) label = QtGui.QLabel("{} {}".format(name, comment)) label.setAlignment(QtCore.Qt.AlignCenter) grid.addWidget(label, 1, 1) self._direction = QtGui.QLabel() self._direction.setAlignment(QtCore.Qt.AlignCenter) grid.addWidget(self._direction, 2, 1) self._override = QtGui.QLabel() self._override.setAlignment(QtCore.Qt.AlignCenter) grid.addWidget(self._override, 3, 1) self._value = QtGui.QLabel() self._value.setAlignment(QtCore.Qt.AlignCenter) grid.addWidget(self._value, 4, 1, 6, 1) self._value.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) menu = QtGui.QActionGroup(self._value) menu.setExclusive(True) self._expctl_action = QtGui.QAction("Experiment controlled", self._value) self._expctl_action.setCheckable(True) menu.addAction(self._expctl_action) self._value.addAction(self._expctl_action) self._expctl_action.triggered.connect(lambda: self.set_mode("exp")) separator = QtGui.QAction(self._value) separator.setSeparator(True) self._value.addAction(separator) self._force1_action = QtGui.QAction("Force 1", self._value) self._force1_action.setCheckable(True) menu.addAction(self._force1_action) self._value.addAction(self._force1_action) self._force1_action.triggered.connect(lambda: self.set_mode("1")) self._force0_action = QtGui.QAction("Force 0", self._value) self._force0_action.setCheckable(True) menu.addAction(self._force0_action) self._value.addAction(self._force0_action) self._force0_action.triggered.connect(lambda: self.set_mode("0")) self._forcein_action = QtGui.QAction("Force input", self._value) self._forcein_action.setCheckable(True) self._forcein_action.setEnabled(not force_out) menu.addAction(self._forcein_action) self._value.addAction(self._forcein_action) self._forcein_action.triggered.connect(lambda: self.set_mode("in")) self.set_value(0, False, False)
def __init__(self, parent, window_title, prev_name, create_cb): QtGui.QDialog.__init__(self, parent=parent) self.setWindowTitle(window_title) self.grid = QtGui.QGridLayout() self.setLayout(self.grid) self.grid.addWidget(QtGui.QLabel("Name:"), 0, 0) self.name = QtGui.QLineEdit() self.grid.addWidget(self.name, 0, 1) if prev_name is not None: self.name.setText(prev_name) def on_accept(): create_cb(self.name.text(), self.get_input()) self.accepted.connect(on_accept)
def __init__(self, send_to_device, channel, sysclk, name, comment): self.send_to_device = send_to_device self.channel = channel self.comment = comment self.sysclk = sysclk self.name = name QtGui.QFrame.__init__(self) self.setFrameShape(QtGui.QFrame.Panel) self.setFrameShadow(QtGui.QFrame.Raised) grid = QtGui.QGridLayout() self.setLayout(grid) label = QtGui.QLabel("{} {}".format(name, comment)) label.setAlignment(QtCore.Qt.AlignCenter) grid.addWidget(label, 1, 1) self._value = QtGui.QLabel() self._value.setAlignment(QtCore.Qt.AlignCenter) grid.addWidget(self._value, 2, 1, 6, 1) self.set_value(0)