当前位置: 首页>>代码示例>>Python>>正文


Python QWizard.show方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QWizard.show方法的典型用法代码示例。如果您正苦于以下问题:Python QWizard.show方法的具体用法?Python QWizard.show怎么用?Python QWizard.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui.QWizard的用法示例。


在下文中一共展示了QWizard.show方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: str

# 需要导入模块: from PyQt4.QtGui import QWizard [as 别名]
# 或者: from PyQt4.QtGui.QWizard import show [as 别名]
        self.nodeNames = globals.GApp.topology.nodes.items()
        for key, elem in Object.items():
            #f.write(str(self.nodeNames[key][1].hostname) + '[labelloc="b", label="\\n\\n\\n\\n\\n' + str(elem[0]) + '\\n' + str(elem[4]) + '", color="white"];\n')
            f.write(unicode(self.nodeNames[key][1].hostname) + '[label="' + unicode(elem[0]) + '\\n' + unicode(elem[4]) + '"];\n')
        for elem in globals.GApp.topology.links:
            f.write(unicode(elem.source.hostname) + ' -- ' + unicode(elem.dest.hostname) + '\n')
        f.write('}')

    def execDOT(self, Object, nodeNumber):
        """Method used to create the temporary filename and launching the dot program, getting a png in output. This png is displayed in the pdf."""
        self.canvas.setPageSize((1200, 860))
        self.writeDotFile(Object, nodeNumber)
        outputfilename = tempfile.mkstemp(suffix='.png')
        os.system('dot -Tpng ' + self.filename[1] + ' -o ' + outputfilename[1])
        self.canvas.drawImage(outputfilename[1], 20, 20)
        del self.filename # remove the tmp file (reference count -> 0)
        #del outputfilename # don't close it yet or it will be deleted
        self.canvas.showPage()
    def finish(self):
        """called when the Wizard has been validated."""
        self.canvas.save()

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = QWizard()
    ui = Ui_Wizard()
    ui.setupUi(window)
    window.show()
    sys.exit(app.exec_())

开发者ID:GNS3,项目名称:gns3-legacy,代码行数:31,代码来源:ExportPDF.py

示例2: Installer

# 需要导入模块: from PyQt4.QtGui import QWizard [as 别名]
# 或者: from PyQt4.QtGui.QWizard import show [as 别名]
class Installer(QObject):
    setProgress = pyqtSignal(int)

    def __init__(self, options, schema, firer):

        QObject.__init__(self)
        if not hasattr(options, 'install_path') or not hasattr(options, 'distrib_path'):
            QMessageBox.warning(firer, u'Error', u'Incorrect options')
            firer.setEnabled(False)
            return

        self.schema = schema

        self.options = options
        self.firer = firer

        self.wizard = QWizard()
        self.wizard.setOptions(QWizard.NoBackButtonOnStartPage | QWizard.NoBackButtonOnLastPage)
        self.wizard.resize(800, 600)
        self.wizard.schema = schema

        self.unwizard = QWizard()
        self.unwizard.setOptions(QWizard.NoBackButtonOnStartPage | QWizard.NoBackButtonOnLastPage)
        self.unwizard.resize(800, 600)
        self.unwizard.schema = schema

        self.pip = self.PreInstallPage(self)
        self.cp = self.CheckPage(self)
        self.ip = self.InstallPage(self)

        self.puip = self.PreUnInstallPage(self)
        self.uip = self.UnInstallPage(self)

        self.wizard.addPage(self.pip)
        self.wizard.addPage(self.cp)
        self.wizard.addPage(self.ip)

        self.unwizard.addPage(self.puip)
        self.unwizard.addPage(self.uip)

    def install(self):
        self.wizard.setModal(True)
        self.wizard.show()

    def uninstall(self):
        self.unwizard.setModal(True)
        self.unwizard.show()

    class PreInstallPage(QWizardPage):
        def __init__(self, parent):
            QWizardPage.__init__(self)
            self.parent = parent

            self.setLayout(QGridLayout())
            self.setTitle('Options')
            self.setSubTitle('Please select destination folder and folder which contains downloaded files.')

            self.path = PathPanel(default=self.parent.options.install_path)
            self.layout().addWidget(QLabel('Installation path:'), 1, 0)
            self.layout().addWidget(self.path, 1, 1)

            self.distrib_path = PathPanel(default=self.parent.options.distrib_path)
            self.layout().addWidget(QLabel('Downloaded files:'), 2, 0)
            self.layout().addWidget(self.distrib_path, 2, 1)

            self.registerField('path', self.path, 'getPath', self.path.path_input.textChanged)
            self.registerField('distrib_path', self.distrib_path, 'getPath', self.distrib_path.path_input.textChanged)

            self.path.updated.connect(self.changed)
            self.distrib_path.updated.connect(self.changed)

        def initializePage(self):
            self.path.setPath(self.parent.options.install_path)
            self.distrib_path.setPath(self.parent.options.distrib_path)

        def changed(self):
            self.completeChanged.emit()

        def isComplete(self):
            return os.path.isdir(self.path.getPath) and os.path.isdir(self.distrib_path.getPath)


    class CheckPage(QWizardPage):
        setProgress = pyqtSignal(int)
        addComponentItem = pyqtSignal(object, str, bool, bool)
        editComponentItem = pyqtSignal(str, str)

        def __init__(self, parent):
            QWizardPage.__init__(self)
            self.parent = parent

            self.setLayout(QGridLayout())
            self.setTitle('Components')
            self.setSubTitle('Please select components which will be extracted to your destination folder.')

            self.status_label = QLabel()
            self.layout().addWidget(self.status_label, 1, 0)

            self.components_list = QListWidget()
            self.progress = QProgressBar()
#.........这里部分代码省略.........
开发者ID:averrin,项目名称:Skywind_Installer,代码行数:103,代码来源:installer.py


注:本文中的PyQt4.QtGui.QWizard.show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。