本文整理汇总了Python中PyQt4.QtCore.Qt.Unchecked方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Unchecked方法的具体用法?Python Qt.Unchecked怎么用?Python Qt.Unchecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.Unchecked方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reloadPlayers
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def reloadPlayers(self, *args):
self.players = []
for p in self.controller.available.keys():
ignored = (p in self.controller.ignored) and Qt.Checked or Qt.Unchecked
self.players.append([PlayerModelState.AVAILABLE,
p, self.getPlayerStat(p, 'ping'),
'', ignored,
self.getPlayerStat(p, 'cc'), ''])
for p, p2 in self.controller.playing.items():
ignored = (p in self.controller.ignored) and Qt.Checked or Qt.Unchecked
self.players.append([PlayerModelState.PLAYING,
p, self.getPlayerStat(p, 'ping'),
p2, ignored,
self.getPlayerStat(p, 'cc'),
self.getPlayerStat(p2, 'cc')])
for p in self.controller.awayfromkb.keys():
ignored = (p in self.controller.ignored) and Qt.Checked or Qt.Unchecked
self.players.append([PlayerModelState.AFK,
p, self.getPlayerStat(p, 'ping'),
'', ignored,
self.getPlayerStat(p, 'cc'), ''])
self.sort(self.lastSort, self.lastSortOrder)
# idx1 = self.createIndex(0, 0)
# idx2 = self.createIndex(len(self.players) - 1, PlayerModel.N_DISPLAY_COLS-1)
# self.dataChanged.emit(idx1, idx2)
示例2: childStateChanged
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def childStateChanged(self, child, newState):
if self.checkState(0) == Qt.Unchecked:
#print "Child Changed while not logging"
QtGui.QTreeWidgetItem.setData(child, 0, Qt.CheckStateRole, newState)
elif self.checkState(0) == Qt.PartiallyChecked:
pass
#print "Waiting for log callback"
elif self.checkState(0) == Qt.Checked:
QtGui.QTreeWidgetItem.setData(child, 0, Qt.CheckStateRole, newState)
if self.noneSelected():
#print "Last child unselected, remove logger"
self.stopLog()
elif self.allSelected():
#print "All children selected while logging, update logger"
self.requestLog()
else:
#print "Child Changed while logging, update logger"
self.requestLog()
示例3: _remove_plot_widgets
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def _remove_plot_widgets(self, closeAll = False):
# helper func to close widgets
def close_ds(ds):
if ds in self.open_ds:
window_id = self.open_ds[ds]
window_id.setCheckState(0,Qt.Unchecked)
# make sure data is consitent
if str(window_id) in self.open_plots:
self.open_plots[str(window_id)].deleteLater()
self.open_plots.pop(str(window_id))
if ds in self.open_ds:
self.open_ds.pop(ds)
if closeAll:
for ds in list(self.open_ds.keys()):
close_ds(ds)
else:
for ds in self.toBe_deleted:
close_ds(ds)
self.toBe_deleted = []
示例4: _initialize
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def _initialize(self, indexes):
self._indexes = indexes
# set up initial min max values
self.current_index = 0
self.min_index = 0
self.max_index = len(self._indexes) - 1
self.index_s_box.update_view(self._indexes, self.current_index)
self._min_spinbox.update_view(self._indexes, self.min_index)
self._max_spinbox.update_view(self._indexes, self.max_index)
self._min_spinbox.setMaximum(self.max_index - 1)
self._max_spinbox.setMinimum(self.min_index + 1)
self._max_active.setCheckState(Qt.Unchecked)
self._min_active.setCheckState(Qt.Unchecked)
self._update_label()
self._min_max_value_changed()
示例5: __init__
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def __init__(self, parent, name, children, hz=50):
super(LogGroup, self).__init__(parent)
self.name = name
self.setFlags(self.flags() | Qt.ItemIsEditable | Qt.ItemIsUserCheckable)
# Keep track of if all/none of the children are active
self.cAll = True
self.cNone = True
self.validHZ = list(OrderedDict.fromkeys([round(100/floor(100/x),2) for x in range(1,100)]))
self.hzTarget = hz
# Monitor the incoming frequency
self.fm = None
self.fmOn = True
# log config
self.lg = None
# Show text
QtGui.QTreeWidgetItem.setData(self, 0, Qt.DisplayRole, QVariant(name))
QtGui.QTreeWidgetItem.setData(self, 0, Qt.CheckStateRole, Qt.Unchecked)
QtGui.QTreeWidgetItem.setData(self, 1, Qt.DisplayRole, "Off")
QtGui.QTreeWidgetItem.setData(self, 3, Qt.DisplayRole, QVariant(0))
#QtGui.QTreeWidgetItem.setData(self, 4, Qt.CheckStateRole, Qt.Unchecked)
self.readSettings()
# Initialise Children
for c in sorted(children.keys()):
self.addChild(LogItem(self, children[c]))
self.c = 0
# Now everything is initialised except the logging
# Start logging if active
if self.checkState(0) == Qt.Checked:
self.requestLog()
示例6: readSettings
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def readSettings(self):
""" Read the HZ and selected things to log from previous session """
settings = QSettings("omwdunkley", "flieROS")
# Read target HZ
hzQv = settings.value("log_"+self.name+"_hz",QVariant(20))
QtGui.QTreeWidgetItem.setData(self, 2, Qt.DisplayRole, hzQv)
self.hzTarget = self.getValidHZ(hzQv.toFloat()[0])
# Read if checked. If partially checked, uncheck
onQv = settings.value("log_"+self.name+"_on", QVariant(Qt.Unchecked))
QtGui.QTreeWidgetItem.setData(self, 0, Qt.CheckStateRole, onQv if onQv.toInt()[0]!=Qt.PartiallyChecked else Qt.Unchecked)
#onRos = settings.value("ros_"+self.name+"_on", QVariant(Qt.Unchecked))
#QtGui.QTreeWidgetItem.setData(self, 0, Qt.CheckStateRole, onRos)
示例7: logStartedCB
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def logStartedCB(self, on):
""" Called when we actually start logging """
self.c+=1
#print "counter[%s]"%self.name, self.c
#if self.c % 2 == 1:
# return
if on:
rospy.loginfo( "[%d: %s @ %.2fhz] LogCB STARTED" % (self.lg.id, self.name, self.hzTarget))
QtGui.QTreeWidgetItem.setData(self, 0, Qt.CheckStateRole, Qt.Checked)
QtGui.QTreeWidgetItem.setData(self, 1, Qt.DisplayRole, "On")
self.setAllState(Qt.Checked, activeOnly=True)
else:
rospy.loginfo( "[%s] LogCB STOPPED" % ( self.name))
#print "[%s]LogCB ENDED(%d) " % (self.name, self.c)
#if self.allSelected():
# self.setAllState(Qt.Unchecked)
##else:
## self.setAllState(Qt.Checked, activeOnly=True)
#QtGui.QTreeWidgetItem.setData(self, 0, Qt.CheckStateRole, Qt.Unchecked)
#QtGui.QTreeWidgetItem.setData(self, 1, Qt.DisplayRole, "Off")
# def logAddedCB(self, l):
# """ Called when log added """
# print "LogCB added"
# QtGui.QTreeWidgetItem.setData(self, 0, Qt.CheckStateRole, Qt.Checked)
# QtGui.QTreeWidgetItem.setData(self, 1, Qt.DisplayRole, "Added")
示例8: stopLog
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def stopLog(self):
""" User request halt """
#print "Requested log stop"
if self.lg:
self.lg.delete() #Invokes logStarted(False)
self.lg = None
if self.allSelected():
self.setAllState(Qt.Unchecked)
#else:
# self.setAllState(Qt.Checked, activeOnly=True)
QtGui.QTreeWidgetItem.setData(self, 0, Qt.CheckStateRole, Qt.Unchecked)
QtGui.QTreeWidgetItem.setData(self, 1, Qt.DisplayRole, "Off")
self.treeWidget().sig_logStatus.emit(self.name, -1)
self.fm = None
示例9: errorLog
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def errorLog(self, block, msg):
""" When a log error occurs """
#print "Log error: %s:", msg
QtGui.QTreeWidgetItem.setData(self, 1, Qt.DisplayRole, "Err: %s"%msg)
QtGui.QTreeWidgetItem.setData(self, 0, Qt.CheckStateRole, Qt.Unchecked)
if self.allSelected():
self.setAllState(Qt.Unchecked)
else:
self.setAllState(Qt.Checked, activeOnly=True)
self.fm = None
示例10: setCheckBoxVulnerableChecked
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def setCheckBoxVulnerableChecked(self, checked=True):
"""
This function changes checkbox's state
:param checked: True or False
:return: None
"""
if checked:
self.checkBoxVulnerable.setCheckState(Qt.Checked)
else:
self.checkBoxVulnerable.setCheckState(Qt.Unchecked)
示例11: data
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Unchecked [as 别名]
def data(self, index, role = Qt.DisplayRole):
if not index.isValid():
return None
if role not in [Qt.DisplayRole, Qt.ToolTipRole, Qt.EditRole]:
return None
data = None
c = index.column()
if c == 0:
if self.utxo_script:
data = self.utxo_script.get_human()
elif c == 1:
if self.tx:
data = b2x(self.tx.serialize())
elif c == 2:
data = self.inIdx
elif c == 3:
data = sighash_types_by_value[self.sighash_type]
elif c == 4:
if role == Qt.CheckStateRole:
data = Qt.Checked if self.anyone_can_pay else Qt.Unchecked
else:
data = self.anyone_can_pay
elif c == self.SigHashName:
data = sig_hash_name(self.sighash_type | SIGHASH_ANYONECANPAY if self.anyone_can_pay else self.sighash_type)
elif c == self.SigHashExplanation:
data = sig_hash_explanation(self.sighash_type | SIGHASH_ANYONECANPAY if self.anyone_can_pay else self.sighash_type)
return data