本文整理汇总了Python中PyQt4.QtGui.QWizardPage.setLayout方法的典型用法代码示例。如果您正苦于以下问题:Python QWizardPage.setLayout方法的具体用法?Python QWizardPage.setLayout怎么用?Python QWizardPage.setLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QWizardPage
的用法示例。
在下文中一共展示了QWizardPage.setLayout方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runConfigWizard
# 需要导入模块: from PyQt4.QtGui import QWizardPage [as 别名]
# 或者: from PyQt4.QtGui.QWizardPage import setLayout [as 别名]
def runConfigWizard(self):
try:
oAuthHandler = tweepy.OAuthHandler(self.options_string['hidden_application_key'],
self.options_string['hidden_application_secret'])
authorizationURL = oAuthHandler.get_authorization_url(True)
self.wizard.setWindowTitle('Twitter plugin configuration wizard')
page1 = QWizardPage()
page2 = QWizardPage()
layout1 = QVBoxLayout()
layout2 = QVBoxLayout()
layoutInputPin = QHBoxLayout()
label1a = QLabel(
'Click next to connect to twitter.com . Please login with your account and follow the instructions in '
'order to authorize creepy')
label2a = QLabel(
'Copy the PIN that you will receive once you authorize cree.py in the field below and click finish')
pinLabel = QLabel('PIN')
inputPin = QLineEdit()
inputPin.setObjectName('inputPin')
analysisHtml = QWebView()
analysisHtml.load(QUrl(authorizationURL))
layout1.addWidget(label1a)
layout2.addWidget(analysisHtml)
layout2.addWidget(label2a)
layoutInputPin.addWidget(pinLabel)
layoutInputPin.addWidget(inputPin)
layout2.addLayout(layoutInputPin)
page1.setLayout(layout1)
page2.setLayout(layout2)
page2.registerField('inputPin*', inputPin)
self.wizard.addPage(page1)
self.wizard.addPage(page2)
self.wizard.resize(800, 600)
if self.wizard.exec_():
try:
oAuthHandler.get_access_token(str(self.wizard.field('inputPin').toString()).strip())
self.options_string['hidden_access_token'] = oAuthHandler.access_token
self.options_string['hidden_access_token_secret'] = oAuthHandler.access_token_secret
self.saveConfiguration(self.config)
except Exception, err:
logger.error(err)
self.showWarning('Error completing the wizard',
'We were unable to obtain the access token for your account, please try to run '
'the wizard again. Error was {0}'.format(err.message))
except Exception, err:
logger.error(err)
self.showWarning('Error completing the wizard', 'Error was: {0}'.format(err.message))
示例2: introPage
# 需要导入模块: from PyQt4.QtGui import QWizardPage [as 别名]
# 或者: from PyQt4.QtGui.QWizardPage import setLayout [as 别名]
def introPage(self):
intro = QWizardPage()
intro.setTitle('Hello and welcome')
label = QLabel('''This is a wizard.
Now you're ready to forecast some time series!
''')
label.setWordWrap(True)
layout = QVBoxLayout()
layout.addWidget(label)
intro.setLayout(layout)
return intro
示例3: runConfigWizard
# 需要导入模块: from PyQt4.QtGui import QWizardPage [as 别名]
# 或者: from PyQt4.QtGui.QWizardPage import setLayout [as 别名]
def runConfigWizard(self):
try:
api = InstagramAPI(client_id=self.options_string['hidden_client_id'],
client_secret=self.options_string['hidden_client_secret'],
redirect_uri=self.options_string['redirect_uri'])
url = api.get_authorize_login_url()
self.wizard.setWindowTitle('Instagram plugin configuration wizard')
page1 = QWizardPage()
layout1 = QVBoxLayout()
txtArea = QLabel()
txtArea.setText('Please copy the following link to your browser window. \n ' +
'Once you authenticate with Instagram you will be redirected to ' +
'www.geocreepy.com and get your token. Copy the token to the input field below:')
urlArea = QLineEdit()
urlArea.setObjectName('urlArea')
urlArea.setText(url)
inputLink = QLineEdit()
inputLink.setObjectName('inputLink')
labelLink = QLabel('Your token value:')
openInBrowserButton = QPushButton('Open in browser')
openInBrowserButton.clicked.connect(functools.partial(self.openLinkInBrowser, url))
layout1.addWidget(txtArea)
layout1.addWidget(urlArea)
layout1.addWidget(openInBrowserButton)
layout1.addWidget(labelLink)
layout1.addWidget(inputLink)
page1.setLayout(layout1)
self.wizard.addPage(page1)
self.wizard.resize(600, 400)
if self.wizard.exec_():
c = str(inputLink.text())
if c:
try:
access_token = api.exchange_code_for_access_token(code=c)
self.options_string['hidden_access_token'] = access_token[0]
self.saveConfiguration(self.config)
except Exception, err:
logger.error(err)
self.showWarning('Error Getting Access Token',
'Please verify that the link you pasted was correct. '
'Try running the wizard again.')
else:
self.showWarning('Error Getting Access Token',
'Please verify that the link you pasted was correct. Try running the wizard again.')
except Exception, err:
logger.error(err)
self.showWarning('Error', 'Error was {0}'.format(err))
示例4: _create_page_id_files
# 需要导入模块: from PyQt4.QtGui import QWizardPage [as 别名]
# 或者: from PyQt4.QtGui.QWizardPage import setLayout [as 别名]
def _create_page_id_files(self):
"""Creates a page for selecting student id files."""
page = QWizardPage(self)
page.setTitle(_('Student id files'))
page.setSubTitle(_('You can select zero, one or more files with the '
'list of student ids. Go to the user manual '
'if you don\'t know the format of the files.'))
self.files_w = widgets.MultipleFilesWidget(
_('Select student list files'),
file_name_filter=FileNameFilters.student_list,
check_file_function=self._check_student_ids_file)
layout = QVBoxLayout()
page.setLayout(layout)
layout.addWidget(self.files_w)
return page
示例5: resultsPage
# 需要导入模块: from PyQt4.QtGui import QWizardPage [as 别名]
# 或者: from PyQt4.QtGui.QWizardPage import setLayout [as 别名]
def resultsPage(self):
results = QWizardPage()
results.setFinalPage(True)
results.setTitle('Results')
self.graph = QLabel("<font style='font-size: 16px;'>Plot</font>")
self.export = QLabel("<font style='font-size: 16px;'>Export</font>")
self.showData = QLabel("<font style='font-size: 16px;'>Data</font>")
self.plotResult = MplWidget(None)
self.plotResult.canvas.fig.set_facecolor('white')
self.resData = QLabel('')
self.resData.setAlignment(Qt.AlignCenter)
self.resData.setWordWrap(True)
self.resData.hide()
self.resFilter = ResFilter()
self.resLayout = QVBoxLayout()
self.resLayout.addWidget(self.export)
self.resLayout.addWidget(self.graph)
self.resLayout.addWidget(self.showData)
self.resLayout.addWidget(self.plotResult)
self.resLayout.addWidget(self.resData)
self.plotResult.hide()
for index in range(0, self.resLayout.count()):
try:
self.resLayout.itemAt(index).widget().setAlignment(Qt.AlignCenter)
self.resLayout.itemAt(index).widget().setStyleSheet('QLabel { color: gray; }')
self.resLayout.itemAt(index).widget().setAttribute(Qt.WA_Hover)
self.resLayout.itemAt(index).widget().installEventFilter(self.resFilter)
except Exception:
pass
self.resLayout.setAlignment(Qt.AlignCenter)
self.resLayout.setSpacing(60)
results.setLayout(self.resLayout)
return results