Ejemplo n.º 1
0
    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())
Ejemplo n.º 2
0
    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())