本文整理汇总了Python中AnyQt.QtWidgets.QComboBox.setFocus方法的典型用法代码示例。如果您正苦于以下问题:Python QComboBox.setFocus方法的具体用法?Python QComboBox.setFocus怎么用?Python QComboBox.setFocus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtWidgets.QComboBox
的用法示例。
在下文中一共展示了QComboBox.setFocus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OWPubmed
# 需要导入模块: from AnyQt.QtWidgets import QComboBox [as 别名]
# 或者: from AnyQt.QtWidgets.QComboBox import setFocus [as 别名]
#.........这里部分代码省略.........
self.pubmed_controls.append(self.retrieve_records_button)
# Num. retrieved records info label.
self.retrieval_info_label = gui.label(
self.controlArea,
self,
'Number of records retrieved: /')
# Load the most recent emails.
self.set_email_list()
# Load the most recent queries.
self.set_keyword_list()
# Check the email and enable controls accordingly.
if self.recent_emails:
email = self.recent_emails[0]
self.email_is_valid = validate_email(email)
self.enable_controls()
def sync_email(self):
email = self.email_combo.currentText()
self.email_is_valid = validate_email(email)
self.enable_controls()
def enable_controls(self):
# Enable/disable controls accordingly.
for control in self.pubmed_controls:
control.setEnabled(self.email_is_valid)
if self.pubmed_api is None or self.pubmed_api.search_record_count == 0:
self.retrieve_records_button.setEnabled(False)
if not self.email_is_valid:
self.email_combo.setFocus()
def run_search(self):
self.Error.clear()
self.Warning.clear()
self.run_search_button.setEnabled(False)
self.retrieve_records_button.setEnabled(False)
# Add the email to history.
email = self.email_combo.currentText()
if email not in self.recent_emails:
self.recent_emails.insert(0, email)
# Check if the PubMed object is present.
if self.pubmed_api is None:
self.pubmed_api = Pubmed(
email=email,
progress_callback=self.api_progress_callback,
error_callback=self.api_error_callback,
)
if self.search_tabs.currentIndex() == 0:
# Get query parameters.
terms = self.keyword_combo.currentText().split()
authors = self.author_input.text().split()
error = self.pubmed_api._search_for_records(
terms, authors, self.pub_date_from, self.pub_date_to
)
if error is not None:
self.Error.api_error(str(error))
return