def __init__(self, parent, i): QtGui.QWizardPage.__init__(self, parent) self._i = i # Create label for description self._text_label = QtGui.QLabel(self) self._text_label.setTextFormat(QtCore.Qt.RichText) self._text_label.setWordWrap(True) # Create label for image self._comicLabel = QtGui.QLabel(self) pm = QtGui.QPixmap() if 'logo' in self._image_filename: pm.load( os.path.join(iep.iepDir, 'resources', 'appicons', self._image_filename)) elif self._image_filename: pm.load( os.path.join(iep.iepDir, 'resources', 'images', self._image_filename)) self._comicLabel.setPixmap(pm) self._comicLabel.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) # Layout theLayout = QtGui.QVBoxLayout(self) self.setLayout(theLayout) # theLayout.addWidget(self._text_label) theLayout.addStretch() theLayout.addWidget(self._comicLabel) theLayout.addStretch()
def _createWidgets(self): # Create list object and label self.lblProjects = QtGui.QLabel('Projects (drag to change the order):', self) self.lstProjects = DraggableList(self) # Create add and remove buttons self.btnAdd = QtGui.QPushButton('New project', self) self.btnAdd.setIcon(iep.icons.add) self.btnRemove = QtGui.QPushButton('Remove selected', self) self.btnRemove.setIcon(iep.icons.delete) # Create fields for description and path self.lblDescription = QtGui.QLabel('Description:', self) self.txtDescription = QtGui.QLineEdit(self) self.lblPath = QtGui.QLabel('Path:', self) self.txtPath = QtGui.QLineEdit(self) self.txtPath.setReadOnly(True) self.chkAddToPath = QtGui.QCheckBox('Add path to Python path', self) # Done button self.btnDone = QtGui.QPushButton("Done", self) self.btnDone.setDefault(True) # Layout L2 = QtGui.QHBoxLayout() L2.addWidget(self.btnAdd) L2.addStretch(1.0) L2.addWidget(self.btnRemove) # L1 = QtGui.QVBoxLayout() L1.addWidget(self.lblProjects) L1.addWidget(self.lstProjects) L1.addLayout(L2) # L4 = QtGui.QHBoxLayout() L4.addStretch(1.0) L4.addWidget(self.btnDone) # L3 = QtGui.QVBoxLayout() L3.addWidget(self.lblDescription) L3.addWidget(self.txtDescription) L3.addWidget(self.lblPath) L3.addWidget(self.txtPath) L3.addWidget(self.chkAddToPath) L3.addStretch(1.0) L3.addLayout(L4) # theLayout = QtGui.QHBoxLayout(self) theLayout.addLayout(L1) theLayout.addLayout(L3) self.setLayout(theLayout)
def __init__(self, parent, i): BaseIEPWizardPage.__init__(self, parent, i) # Create label and checkbox t1 = translate('wizard', "This wizard can be opened using 'Help > IEP wizard'") t2 = translate('wizard', "Show this wizard on startup") self._label_info = QtGui.QLabel(t1, self) self._check_show = QtGui.QCheckBox(t2, self) self._check_show.stateChanged.connect(self._setNewUser) # Create language switcher self._langLabel = QtGui.QLabel(translate('wizard', "Select language"), self) # self._langBox = QtGui.QComboBox(self) self._langBox.setEditable(False) # Fill index, theIndex = -1, -1 cur = iep.config.settings.language for lang in sorted(LANGUAGES): index += 1 self._langBox.addItem(lang) if lang == LANGUAGE_SYNONYMS.get(cur, cur): theIndex = index # Set current index if theIndex >= 0: self._langBox.setCurrentIndex(theIndex) # Bind signal self._langBox.activated.connect(self.onLanguageChange) # Init check state if iep.config.state.newUser: self._check_show.setCheckState(QtCore.Qt.Checked) # Create sublayout layout = QtGui.QHBoxLayout() layout.addWidget(self._langLabel, 0) layout.addWidget(self._langBox, 0) layout.addStretch(2) self.layout().addLayout(layout) # Add to layout self.layout().addSpacing(10) self.layout().addWidget(self._label_info) self.layout().addWidget(self._check_show)
def __init__(self, parent): QtGui.QWidget.__init__(self, parent) # Create layout self._formLayout = QtGui.QFormLayout(self) # Collect classes of widgets to instantiate classes = [] for t in self.INFO_KEYS: className = 'ShellInfo_' + t.key cls = globals()[className] classes.append((t, cls)) # Instantiate all classes self._shellInfoWidgets = {} for t, cls in classes: # Instantiate and store instance = cls(self) self._shellInfoWidgets[t.key] = instance # Create label label = QtGui.QLabel(t, self) label.setToolTip(t.tt) # Add to layout self._formLayout.addRow(label, instance) # Add delete button t = translate('shell', 'Delete ::: Delete this shell configuration') label = QtGui.QLabel('', self) instance = QtGui.QPushButton(iep.icons.cancel, t, self) instance.setToolTip(t.tt) instance.setAutoDefault(False) instance.clicked.connect(self.parent().parent().onTabClose) deleteLayout = QtGui.QHBoxLayout() deleteLayout.addWidget(instance, 0) deleteLayout.addStretch(1) # Add to layout self._formLayout.addRow(label, deleteLayout) # Apply layout self._formLayout.setSpacing(15) self.setLayout(self._formLayout)
def __init__(self, parent): QtGui.QWidget.__init__(self, parent) # Create label widget and costumize self._label = QtGui.QLabel(self) self._label.setTextFormat(QtCore.Qt.RichText) self._label.setOpenExternalLinks(True) self._label.setWordWrap(True) self._label.setMargin(20) # Set font a wee bit larger font = self._label.font() font.setPointSize(font.pointSize() + 1) self._label.setFont(font) # Set text self._label.setText(license_text1) layout = QtGui.QVBoxLayout(self) self.setLayout(layout) layout.addStretch(1) layout.addWidget(self._label, 0) layout.addStretch(1)