本文整理汇总了Python中PySide.QtGui.QCheckBox.isEnabled方法的典型用法代码示例。如果您正苦于以下问题:Python QCheckBox.isEnabled方法的具体用法?Python QCheckBox.isEnabled怎么用?Python QCheckBox.isEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QCheckBox
的用法示例。
在下文中一共展示了QCheckBox.isEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _PhotonDistributionResultOptionsToolItem
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import isEnabled [as 别名]
class _PhotonDistributionResultOptionsToolItem(_ResultToolItem):
def _initUI(self):
# Variables
result = self.result()
transitions = sorted(result.iter_transitions())
transition0 = transitions[0]
model = _TransitionListModel(transitions)
# Widgets
self._chk_errorbar = QCheckBox("Show error bars")
self._chk_errorbar.setChecked(True)
self._cb_transition = QComboBox()
self._cb_transition.setModel(model)
self._cb_transition.setCurrentIndex(0)
self._chk_pg = QCheckBox("No absorption, no fluorescence")
state = result.exists(transition0, True, False, False, False)
self._chk_pg.setEnabled(state)
self._chk_pg.setChecked(state)
self._chk_eg = QCheckBox("With absorption, no fluorescence")
state = result.exists(transition0, True, True, False, False)
self._chk_eg.setEnabled(state)
self._chk_eg.setChecked(state)
self._chk_pt = QCheckBox("No absorption, with fluorescence")
state = result.exists(transition0, True, False, True, True)
self._chk_pt.setEnabled(state)
self._chk_pt.setChecked(state)
self._chk_et = QCheckBox("With absorption, with fluorescence")
state = result.exists(transition0, True, True, True, True)
self._chk_et.setEnabled(state)
self._chk_et.setChecked(state)
# Layouts
layout = _ResultToolItem._initUI(self)
layout.addRow(self._chk_errorbar)
layout.addRow("Transition", self._cb_transition)
boxlayout = QVBoxLayout()
boxlayout.addWidget(self._chk_pg)
boxlayout.addWidget(self._chk_eg)
boxlayout.addWidget(self._chk_pt)
boxlayout.addWidget(self._chk_et)
box_generated = QGroupBox("Curves")
box_generated.setLayout(boxlayout)
layout.addRow(box_generated)
# Signals
self._cb_transition.currentIndexChanged.connect(self._onTransitionChanged)
self._chk_pg.stateChanged.connect(self.stateChanged)
self._chk_eg.stateChanged.connect(self.stateChanged)
self._chk_pt.stateChanged.connect(self.stateChanged)
self._chk_et.stateChanged.connect(self.stateChanged)
self._chk_errorbar.stateChanged.connect(self.stateChanged)
return layout
def _onTransitionChanged(self):
result = self.result()
index = self._cb_transition.currentIndex()
transition = self._cb_transition.model().transition(index)
self._chk_pg.setEnabled(result.exists(transition, True, False, False, False))
self._chk_eg.setEnabled(result.exists(transition, True, True, False, False))
self._chk_pt.setEnabled(result.exists(transition, True, False, True, True))
self._chk_et.setEnabled(result.exists(transition, True, True, True, True))
self.stateChanged.emit()
def transition(self):
index = self._cb_transition.currentIndex()
return self._cb_transition.model().transition(index)
def showConditions(self):
return (
self._chk_pg.isChecked() and self._chk_pg.isEnabled(),
self._chk_eg.isChecked() and self._chk_eg.isEnabled(),
self._chk_pt.isChecked() and self._chk_pt.isEnabled(),
self._chk_et.isChecked() and self._chk_et.isEnabled(),
)
def showErrorbar(self):
return self._chk_errorbar.isChecked()