本文整理汇总了Python中PySide.QtGui.QCheckBox.palette方法的典型用法代码示例。如果您正苦于以下问题:Python QCheckBox.palette方法的具体用法?Python QCheckBox.palette怎么用?Python QCheckBox.palette使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QCheckBox
的用法示例。
在下文中一共展示了QCheckBox.palette方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import palette [as 别名]
#.........这里部分代码省略.........
fastRadio = QRadioButton('Fast', self._window)
notVisRadio = QRadioButton('Not visible', self._window)
slowRadio.setChecked(True)
self._speedGroup = QButtonGroup(self._window)
self._speedGroup.addButton(slowRadio, 0)
self._speedGroup.addButton(medRadio, 1)
self._speedGroup.addButton(fastRadio, 2)
self._speedGroup.addButton(notVisRadio, 3)
self._speedGroup.buttonClicked.connect(self._onSpeedChange)
layout = QVBoxLayout()
layout.addWidget(self._runBtn)
layout.addWidget(self._stepBtn)
layout.addWidget(slowRadio)
layout.addWidget(medRadio)
layout.addWidget(fastRadio)
layout.addWidget(notVisRadio)
grpBx = QGroupBox("Run Controls")
grpBx.setLayout(layout)
grpBx.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
return grpBx
def _buildResultsPanel(self):
'''
Creates the sub-panel containing displays widgets for informing the
user on the results of running the algorithm.
'''
self._doneLbl = QLabel("No", self._window)
self._solvableLbl = QLabel("Yes", self._window)
#_doneLbl is highlighted green upon successful algorithm completion
pal = self._doneLbl.palette()
pal.setColor(QPalette.Window, Qt.green)
self._doneLbl.setPalette(pal)
#_solvableLbl is highlighted red if the world model isn't solvable
pal = self._solvableLbl.palette()
pal.setColor(QPalette.Window, Qt.red)
self._solvableLbl.setPalette(pal)
layout = QGridLayout()
layout.addWidget(QLabel("Path Found:"), 0, 0)
layout.addWidget(self._doneLbl, 0, 1)
layout.addWidget(QLabel("Is Solvable:"), 1, 0)
layout.addWidget(self._solvableLbl, 1, 1)
grpBx = QGroupBox("Results")
grpBx.setLayout(layout)
grpBx.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
return grpBx
def _buildRenderingOptions(self):
'''
Creates the sub-panel containing control widgets for setting options
in how the world is rendered on the GUI.
'''
self._openChk = QCheckBox("Active Cells")
self._visitedChk = QCheckBox("Visited Cells")
self._pathChk = QCheckBox("Draw Path")
self._costChk = QCheckBox("Draw Estimated Costs")
pal = self._openChk.palette()
pal.setColor(QPalette.WindowText, Qt.green)
self._openChk.setPalette(pal)