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 __init__(self, parent): QtGui.QWizard.__init__(self, parent) # Set some appearance stuff self.setMinimumSize(600, 500) self.setWindowTitle(translate('wizard', 'Getting started with IEP')) self.setWizardStyle(self.ModernStyle) self.setButtonText(self.CancelButton, 'Stop') # Set logo pm = QtGui.QPixmap() pm.load( os.path.join(iep.iepDir, 'resources', 'appicons', 'ieplogo48.png')) self.setPixmap(self.LogoPixmap, pm) # Define pages klasses = [ IntroWizardPage, TwocomponentsWizardPage, EditorWizardPage, ShellWizardPage1, ShellWizardPage2, RuncodeWizardPage1, RuncodeWizardPage2, ToolsWizardPage1, ToolsWizardPage2, FinalPage ] # Create pages self._n = len(klasses) for i, klass in enumerate(klasses): self.addPage(klass(self, i))
def _getPixmap(self, icon): # Get icon if given by name if isinstance(icon, str): icon = iep.icons[icon] # Create pixmap if icon is None: pm = QtGui.QPixmap(16, 16) pm.fill(QtGui.QColor(0, 0, 0, 0)) return pm elif isinstance(icon, tuple): pm = QtGui.QPixmap(icon[0], icon[1]) pm.fill(QtGui.QColor(0, 0, 0, 0)) return pm elif isinstance(icon, QtGui.QPixmap): return icon elif isinstance(icon, QtGui.QIcon): return icon.pixmap(16, 16) else: raise ValueError( 'Icon for IconArtis should be icon, pixmap or name.')