Beispiel #1
0
 def __init__(self, field, parent=None):
     QHBoxLayout.__init__(self)
     self.field = field
     self.count = QSpinBox()
     self.count.setFixedWidth(45)
     self.addWidget(self.field)
     self.addWidget(self.count)
Beispiel #2
0
 def __init__(self, value, parent=None):
     QHBoxLayout.__init__(self)
     index = value.find('@')
     if index != -1:
         value, default = value[:index], int(value[index+1:])
     else:
         default = False
     parsed = value.split(':')
     self.slider = QSlider(Qt.Horizontal)
     if parsed[-1] == '':
         self.slider.setTickPosition(2)
         parsed.pop(-1)
     if len(parsed) == 2:
         self.slider.setMaximum(int(parsed[1]))
     elif len(parsed) == 3:
         self.slider.setMinimum(int(parsed[1]))
         self.slider.setMaximum(int(parsed[2]))
     if default:
         self.slider.setValue(default)  # always set value in last
     if SIGNAL is None:
         self.slider.valueChanged.connect(self.update)
     else:
         self.connect(self.slider, SIGNAL("valueChanged(int)"), self.update)
     self.cpt = QLabel(str(self.value()))
     self.addWidget(self.slider)
     self.addWidget(self.cpt)
Beispiel #3
0
 def __init__(self, value, parent=None):
     QHBoxLayout.__init__(self)
     self.value = value
     self.lineedit = QLineEdit('', parent)
     self.addWidget(self.lineedit)
     self.filebtn = QPushButton('Browse')
     self.filebtn.clicked.connect(self.getfile)
     self.addWidget(self.filebtn)
Beispiel #4
0
 def __init__(self, boxes, checks, parent=None):
     QHBoxLayout.__init__(self)
     self.setSpacing(0)
     self.group = QButtonGroup()
     self.group.setExclusive(False)
     for i, (box, check) in enumerate(zip(boxes, checks)):
         cbx = QCheckBox(box)
         cbx.setChecked(eval(check))
         self.addWidget(cbx)
         self.group.addButton(cbx, i)
Beispiel #5
0
 def __init__(self, buttons, parent=None):
     QHBoxLayout.__init__(self)
     self.result = parent.result
     self.dialog = parent.get_dialog()
     for button in buttons:
         label, callback = button
         self.btn = QPushButton(label)
         if SIGNAL is None:
             self.btn.clicked.connect(self.call(callback))
         else:
             self.connect(self.btn, SIGNAL("clicked()"), self.call(callback))
         self.addWidget(self.btn)
Beispiel #6
0
 def __init__(self, color, parent=None):
     QHBoxLayout.__init__(self)
     assert isinstance(color, QColor)
     self.lineedit = QLineEdit(color.name(), parent)
     if SIGNAL is None:
         self.lineedit.textChanged.connect(self.update_color)
     else:
         self.connect(self.lineedit, SIGNAL("textChanged(QString)"),self.update_color)
     self.addWidget(self.lineedit)
     self.colorbtn = ColorButton(parent)
     self.colorbtn.color = color
     self.colorbtn.colorChanged.connect(self.update_text)
     self.addWidget(self.colorbtn)