class RangeDialog(QDialog): def __init__(self, title): QDialog.__init__(self, None, Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint) self.setFixedWidth(220) self.setWindowTitle(title) self.setModal(True) self.ok_button = QPushButton('OK') self.ok_button.setDefault(True) self.ok_button.clicked.connect(self.accept) self.cancel_button = QPushButton('Cancel') self.cancel_button.clicked.connect(self.reject) frame = QFrame(); frame.setFrameShape(QFrame.HLine) frame.setFrameShadow(QFrame.Sunken) frame.setFixedHeight(10) hl = QHBoxLayout() hl.addWidget(self.ok_button, 1, Qt.AlignLeft) hl.addWidget(self.cancel_button, 0, Qt.AlignRight) vl = QVBoxLayout() vl.addWidget(frame) vl.addLayout(hl) self.setLayout(vl) def display(self): self.exec_()
def __init__(self, title): QDialog.__init__( self, None, Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint) self.setFixedWidth(220) self.setWindowTitle(title) self.setModal(True) self.ok_button = QPushButton('OK') self.ok_button.setDefault(True) self.ok_button.clicked.connect(self.accept) self.cancel_button = QPushButton('Cancel') self.cancel_button.clicked.connect(self.reject) frame = QFrame() frame.setFrameShape(QFrame.HLine) frame.setFrameShadow(QFrame.Sunken) frame.setFixedHeight(10) hl = QHBoxLayout() hl.addWidget(self.ok_button, 1, Qt.AlignLeft) hl.addWidget(self.cancel_button, 0, Qt.AlignRight) vl = QVBoxLayout() vl.addWidget(frame) vl.addLayout(hl) self.setLayout(vl)
def __init__(self): QPushButton.__init__(self) self.setText('R') font = QFont() font.setPixelSize(8) self.setFont(font) self.setFixedSize(18, 18) self.range_from = None self.range_to = None self.range_step = None self.values = [] self._active = False
def __init__(self): QPushButton.__init__(self) self.setText('R') font = QFont() font.setPixelSize(8) self.setFont(font) self.setFixedSize(18, 18) self.range_type = None self.range_from = None self.range_to = None self.range_step = None self.values = [] self._active = False