def __init__(self, parent=None): KVBox.__init__(self, parent) self.help = QLabel(i18n(helpText), self) self.layout().setAlignment(self.help, Qt.AlignHCenter | Qt.AlignTop) self.setSpacing(40) hBox = KHBox(self) vBox1 = KVBox(hBox) vBox2 = KVBox(hBox) hBox.layout().setAlignment(vBox1, Qt.AlignHCenter) hBox.layout().setAlignment(vBox2, Qt.AlignHCenter) vBox1.setMargin(20) vBox2.setSpacing(20) self.datePickerLabel = QLabel("KDatePicker", vBox1) self.datePicker = KDatePicker(vBox2) self.datePicker.setFixedSize(400, 200) self.other = QLabel('KDateWidget', vBox1) vBox1.layout().setAlignment(self.other, Qt.AlignBottom) self.dateDisplay = KDateWidget(vBox2) self.connect(self.datePicker, SIGNAL('dateChanged(QDate)'), self.dateDisplay.setDate)
def __init__(self, parent=None): KVBox.__init__(self, parent) self.help = QLabel(i18n(helpText), self) self.layout().setAlignment(self.help, Qt.AlignHCenter) self.setSpacing(10) hBox = KHBox(self) self.layout().setAlignment(hBox, Qt.AlignHCenter) cBox = KVBox(hBox) hBox.layout().setAlignment(cBox, Qt.AlignTop) hBox.setSpacing(25) hBox.setMargin(10) self.stdDirs = KStandardDirs() types = self.stdDirs.allTypes() comboLbl = QLabel("Types", cBox) combo = KComboBox(cBox) combo.addItems(types) cBox.layout().setAlignment(comboLbl, Qt.AlignTop) cBox.layout().setAlignment(combo, Qt.AlignTop) self.connect(combo, SIGNAL("currentIndexChanged (const QString&)"), self.slotIndexChanged) lBox = KVBox(hBox) listLbl = QLabel("Directories", lBox) self.location = KListWidget(lBox) self.location.setMaximumSize(400, 200) lBox.layout().setAlignment(listLbl, Qt.AlignTop) lBox.layout().setAlignment(self.location, Qt.AlignTop) self.slotIndexChanged(combo.currentText())
def __init__(self, parent=None): super(KVBox, self).__init__(parent) self.help = QLabel(i18n(helpText), self) self.layout().setAlignment(self.help, Qt.AlignHCenter) self.setSpacing(10) hBox = KHBox(self) self.layout().setAlignment(hBox, Qt.AlignHCenter) cBox = KVBox(hBox) hBox.layout().setAlignment(cBox, Qt.AlignTop) hBox.setSpacing(25) hBox.setMargin(10) self.stdDirs = KStandardDirs() types = self.stdDirs.allTypes() comboLbl = QLabel("Types", cBox) combo = KComboBox(cBox) combo.addItems(types) cBox.layout().setAlignment(comboLbl, Qt.AlignTop) cBox.layout().setAlignment(combo, Qt.AlignTop) # We're calling the QString version of the signal, as # currentIndexChanged can also be emitted with an int (the index that # changed) combo.currentIndexChanged[QString].connect(self.slotIndexChanged) lBox = KVBox(hBox) listLbl = QLabel("Directories", lBox) self.location = KListWidget(lBox) self.location.setMaximumSize(400, 200) lBox.layout().setAlignment(listLbl, Qt.AlignTop) lBox.layout().setAlignment(self.location, Qt.AlignTop) QLabel(self.stdDirs.installPath("ui"), self) self.slotIndexChanged(combo.currentText())