本文整理汇总了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()
示例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)
示例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)
示例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)