當前位置: 首頁>>代碼示例>>Python>>正文


Python Qt.QWizardPage類代碼示例

本文整理匯總了Python中PyQt4.Qt.QWizardPage的典型用法代碼示例。如果您正苦於以下問題:Python QWizardPage類的具體用法?Python QWizardPage怎麽用?Python QWizardPage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了QWizardPage類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, db, parent):
        QWizardPage.__init__(self, parent)
        self.db = db
        self.register = parent.register
        self.setupUi(self)

        self.do_init()
開發者ID:089git,項目名稱:calibre,代碼行數:7,代碼來源:__init__.py

示例2: __init__

 def __init__(self):
     QWizardPage.__init__(self)
     self.setupUi(self)
     self.registerField('library_location', self.location)
     self.button_change.clicked[()].connect(self.change)
     self.init_languages()
     self.language.currentIndexChanged[int].connect(self.change_language)
     self.location.textChanged.connect(self.location_text_changed)
開發者ID:Hainish,項目名稱:calibre,代碼行數:8,代碼來源:__init__.py

示例3: __init__

 def __init__(self):
     QWizardPage.__init__(self)
     self.setupUi(self)
     self.registerField('library_location', self.location)
     self.connect(self.button_change, SIGNAL('clicked()'), self.change)
     self.init_languages()
     self.language.currentIndexChanged[int].connect(self.change_language)
     self.connect(self.location, SIGNAL('textChanged(QString)'),
             self.location_text_changed)
開發者ID:yeyanchao,項目名稱:calibre,代碼行數:9,代碼來源:__init__.py

示例4: __init__

        def __init__(self, dirname, purrlogs, parent=None, create=None, message=None):
            QWizardPage.__init__(self, parent)
            self.dirname = dirname
            self.purrlogs = purrlogs or []
            bg = QButtonGroup(self)
            lo = QVBoxLayout()
            self.setLayout(lo)
            # set page titles
            self.setTitle("Starting PURR")
            message and self.setSubTitle(message)
            if not purrlogs:
                self.rbs_log = []
            else:
                # add options for existing purrlogs
                self.rbs_log = [QRadioButton("Load %s" % Kittens.utils.collapseuser(log)) for log in purrlogs]
                for rb in self.rbs_log:
                    lo.addWidget(rb)
                    bg.addButton(rb)
                    QObject.connect(rb, SIGNAL("toggled(bool)"), self.checkCompleteness)
                self.rbs_log[0].setChecked(True)
            # add option to load another purrlog
            lo1 = QHBoxLayout()
            self.rb_other = QRadioButton("Load purrlog from:")
            lo1.addWidget(self.rb_other)
            bg.addButton(self.rb_other)
            self.wother = QLineEdit()
            self.wother.setReadOnly(True)
            lo1.addWidget(self.wother, 1)
            pb = QPushButton(pixmaps.folder_open.icon(), "")
            QObject.connect(pb, SIGNAL("clicked()"), self._select_other_dialog)
            QObject.connect(self.rb_other, SIGNAL("toggled(bool)"), pb.setEnabled)
            QObject.connect(self.rb_other, SIGNAL("toggled(bool)"), self.wother.setEnabled)
            QObject.connect(self.rb_other, SIGNAL("toggled(bool)"), self.checkCompleteness)
            pb.setEnabled(False)
            self.wother.setEnabled(False)
            lo1.addWidget(pb)
            lo.addLayout(lo1)
            self.load_path = None

            # add option to create new purrlog
            lo1 = QHBoxLayout()
            self.rb_create = QRadioButton("Create new purrlog:")
            lo1.addWidget(self.rb_create)
            bg.addButton(self.rb_create)
            self.wcreate = QLineEdit()
            lo1.addWidget(self.wcreate, 1)
            pb = QPushButton(pixmaps.folder_open.icon(), "")
            QObject.connect(pb, SIGNAL("clicked()"), self._select_create_dialog)
            QObject.connect(self.rb_create, SIGNAL("toggled(bool)"), pb.setEnabled)
            QObject.connect(self.rb_create, SIGNAL("toggled(bool)"), self.wcreate.setEnabled)
            QObject.connect(self.rb_create, SIGNAL("toggled(bool)"), self.checkCompleteness)
            QObject.connect(self.wcreate, SIGNAL("editingFinished()"), self._validate_create_filename)
            pb.setEnabled(False)
            self.wcreate.setEnabled(False)
            # this holds the last validated name
            self._validated_create_path = None
            self._validated_result = False
            # generate default name for a new purrlog
            self.create_path = os.path.join(dirname, "purrlog")
            num = 0
            while os.path.exists(self.create_path):
                self.create_path = os.path.join(dirname, "purrlog.%d" % num)
                num += 1
            # This will be not None as long as a valid name is entered
            self.create_path = Kittens.utils.collapseuser(os.path.normpath(self.create_path))
            if create:
                self.wcreate.setText(create or Kittens.utils.collapseuser(create))
                # this will emit checkCompleteness(), causing a _validate_create_filename() call, causing the content of the wcreate widget
                # to be validated and copied to create_path if valid, or reset from create_path if invalid
                self.rb_create.setChecked(True)
            else:
                self.wcreate.setText(self.create_path)

            lo1.addWidget(pb)
            lo.addLayout(lo1)

            # make create option default, if no purrlogs
            if not purrlogs:
                self.rb_create.setChecked(True)
開發者ID:kernsuite-debian,項目名稱:purr,代碼行數:79,代碼來源:Startup.py


注:本文中的PyQt4.Qt.QWizardPage類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。