本文整理汇总了Python中PyQt5.QtWidgets.QButtonGroup.blockSignals方法的典型用法代码示例。如果您正苦于以下问题:Python QButtonGroup.blockSignals方法的具体用法?Python QButtonGroup.blockSignals怎么用?Python QButtonGroup.blockSignals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QButtonGroup
的用法示例。
在下文中一共展示了QButtonGroup.blockSignals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ApplicationPage
# 需要导入模块: from PyQt5.QtWidgets import QButtonGroup [as 别名]
# 或者: from PyQt5.QtWidgets.QButtonGroup import blockSignals [as 别名]
#.........这里部分代码省略.........
options_layout.addWidget(self._console_edit)
self._bundle_edit = QCheckBox("Application bundle (OS X)",
whatsThis="Build an application bundle on OS X. If it is not "
"checked then the application will be built as a "
"simple executable.",
stateChanged=self._bundle_changed)
options_layout.addWidget(self._bundle_edit)
options_layout.addStretch()
layout.addLayout(options_layout, 0, 1)
self._package_edit = _ApplicationPackageEditor()
self._package_edit.package_changed.connect(self._package_changed)
package_edit_gb = QGroupBox(self._package_edit.title)
package_edit_gb.setLayout(self._package_edit)
layout.addWidget(package_edit_gb, 1, 0, 1, 2)
layout.setRowStretch(1, 1)
self.setLayout(layout)
def _update_page(self):
""" Update the page using the current project. """
project = self.project
self._name_edit.setText(project.application_name)
self._script_edit.setText(project.application_script)
self._entry_point_edit.setText(project.application_entry_point)
self._sys_path_edit.setText(project.sys_path)
self._package_edit.configure(project.application_package, project)
blocked = self._pyqt_versions_bg.blockSignals(True)
for rb in self._pyqt_versions_bg.buttons():
if rb.text() == 'PyQt5':
rb.setChecked(project.application_is_pyqt5)
else:
rb.setChecked(not project.application_is_pyqt5)
self._pyqt_versions_bg.blockSignals(blocked)
blocked = self._console_edit.blockSignals(True)
self._console_edit.setCheckState(
Qt.Checked if project.application_is_console else Qt.Unchecked)
self._console_edit.blockSignals(blocked)
blocked = self._bundle_edit.blockSignals(True)
self._bundle_edit.setCheckState(
Qt.Checked if project.application_is_bundle else Qt.Unchecked)
self._bundle_edit.blockSignals(blocked)
def _pyqt_version_changed(self, button, checked):
""" Invoked when the user changes the PyQt version number. """
if button.text() == 'PyQt5':
self.project.application_is_pyqt5 = checked
self.project.modified = True
self.pyqt_version_changed.emit(checked)
def _console_changed(self, state):
""" Invoked when the user changes the console state. """
self.project.application_is_console = (state == Qt.Checked)