本文整理汇总了Python中PySide.QtGui.QCheckBox.setDisabled方法的典型用法代码示例。如果您正苦于以下问题:Python QCheckBox.setDisabled方法的具体用法?Python QCheckBox.setDisabled怎么用?Python QCheckBox.setDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QCheckBox
的用法示例。
在下文中一共展示了QCheckBox.setDisabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SceneTab
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import setDisabled [as 别名]
class SceneTab(QWidget): # FIXME I'm Ugly.
"""This widget is for changing the Scene propagation policies
of the module.
"""
def __init__(self, parent, agent):
"""Construct the SceneTab with the given parent (TabDialog) and
ModuleAgent.
"""
super(SceneTab, self).__init__(parent)
self.agent = agent
self.layout = QVBoxLayout()
self.layout.setAlignment(Qt.AlignCenter)
self.layout.addWidget(self.buildHighlightGroupBox())
self.layout.addItem(QSpacerItem(5, 5))
self.layout.addWidget(self.buildModuleGroupBox())
self.layout.addItem(QSpacerItem(5, 5))
self.layout.addWidget(self.buildAttributeGroupBox())
self.setLayout(self.layout)
def buildHighlightGroupBox(self):
"""Layout/construct the highlight UI for this tab."""
groupBox = QGroupBox("Highlight Policy")
layout = QVBoxLayout()
# agent.propagate_highlights
self.highlights_propagate = QCheckBox("Propagate highlights to " + "other modules.")
self.highlights_propagate.setChecked(self.agent.propagate_highlights)
self.highlights_propagate.stateChanged.connect(self.highlightsPropagateChanged)
# We only allow this change if the parent does not propagate
if self.agent.parent().propagate_highlights:
self.highlights_propagate.setDisabled(True)
# agent.apply_highlights
self.applyHighlights = QCheckBox("Apply highlights from " + "other modules.")
self.applyHighlights.setChecked(self.agent.apply_highlights)
self.applyHighlights.stateChanged.connect(self.applyHighlightsChanged)
layout.addWidget(self.applyHighlights)
layout.addItem(QSpacerItem(5, 5))
layout.addWidget(self.highlights_propagate)
groupBox.setLayout(layout)
return groupBox
def highlightsPropagateChanged(self):
"""Called when highlight propagtion is changed to update the
Agent.
"""
self.agent.propagate_highlights = self.highlights_propagate.isChecked()
def applyHighlightsChanged(self):
"""Called when highlight application is changed to update the
Agent.
"""
self.agent.apply_highlights = self.applyHighlights.isChecked()
def buildModuleGroupBox(self):
"""Layout/construct the ModuleScene UI for this tab."""
groupBox = QGroupBox("Module Policy")
layout = QVBoxLayout()
# agent.propagate_module_scenes
self.module_propagate = QCheckBox("Propagate module scene information " + "to other modules.")
self.module_propagate.setChecked(self.agent.propagate_module_scenes)
self.module_propagate.stateChanged.connect(self.modulePropagateChanged)
# We only allow this change if the parent does not propagate
if self.agent.parent().propagate_module_scenes:
self.module_propagate.setDisabled(True)
# agent.apply_module_scenes
self.module_applyScene = QCheckBox("Apply module scene information " + "from other modules.")
self.module_applyScene.setChecked(self.agent.apply_module_scenes)
self.module_applyScene.stateChanged.connect(self.moduleApplyChanged)
layout.addWidget(self.module_applyScene)
layout.addItem(QSpacerItem(5, 5))
layout.addWidget(self.module_propagate)
groupBox.setLayout(layout)
return groupBox
def modulePropagateChanged(self):
"""Called when ModuleScene propagtion is changed to update the
Agent.
"""
self.agent.propagate_module_scenes = self.module_propagate.isChecked()
def moduleApplyChanged(self):
"""Called when ModuleScene application is changed to update the
Agent.
"""
self.agent.apply_module_scenes = self.module_applyScene.isChecked()
def buildAttributeGroupBox(self):
"""Layout/construct the AttributeScene UI for this tab."""
groupBox = QGroupBox("Attribute Policy (Colors)")
layout = QVBoxLayout()
#.........这里部分代码省略.........