本文整理汇总了Python中PyQt5.QtCore.Qt.Unchecked方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Unchecked方法的具体用法?Python Qt.Unchecked怎么用?Python Qt.Unchecked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.Unchecked方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _remove_plot_widgets
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.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 = []
示例2: enable_diffmode
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def enable_diffmode(self):
'''This function enables the diffmode checkbox iif the number of checked
revision == 2. The reason is that we want to apply diff styles to
features only between two revisions. When the checkbox is enabled, users
can check it. If it was checked at one point and the number of selected
revisions != 2, then it is unchecked and disabled.
Intended use in : versioning.view
'''
# print("in enable_diffmode")
nb_checked_revs = 0
for i in range(self.q_view_dlg.tblw.rowCount()):
# check if tblw.item(0,0) is not None (bug with Qt slots ?)
if self.q_view_dlg.tblw.item(0, 0):
if self.q_view_dlg.tblw.item(i, 0).checkState():
nb_checked_revs += 1
else:
return
if nb_checked_revs == 2:
self.q_view_dlg.diffmode_chk.setEnabled(True)
else:
self.q_view_dlg.diffmode_chk.setCheckState(Qt.Unchecked)
self.q_view_dlg.diffmode_chk.setEnabled(False)
示例3: _del_option
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def _del_option(self, parent: QTreeWidgetItem, child: QTreeWidgetItem):
self.blockSignals(True)
parent.removeChild(child)
selected_option = False
for i in range(parent.childCount()):
parent.child(i).setData(0, 35, i)
if parent.child(i).checkState(0) == Qt.Checked:
selected_option = True
if parent.childCount() > 0 and not selected_option:
parent.child(0).setCheckState(0, Qt.Checked)
# Deselects if no options left
if not parent.childCount():
parent.setCheckState(0, Qt.Unchecked)
self.blockSignals(False)
self.update_size()
示例4: check_dependency
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def check_dependency(self, item: QTreeWidgetItem):
"""
Looks for mentioned dependents, and enables/disables those depending on checkstate.
:param item: changed item from QTreeWidget (paramTree)
:type item: QTreeWidget
"""
if item.data(0, 33) == 0 and item.data(0, 37):
for i in item.data(0, 37):
if item.checkState(0) == Qt.Unchecked:
self.blockSignals(True)
i.setDisabled(True)
i.setExpanded(False)
self.blockSignals(False)
i.setCheckState(0, Qt.Unchecked)
else:
self.blockSignals(True)
i.setDisabled(False)
self.blockSignals(False)
示例5: data
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def data(self, index, role):
if not index.isValid():
return None
if index.column() == 0:
value = ('' if self.my_data[index.row()][index.column() + 1]
else 'Skip')
else:
value = self.my_data[index.row()][index.column() + 1]
if role == Qt.EditRole:
return value
elif role == Qt.DisplayRole:
return value
elif role == Qt.CheckStateRole:
if index.column() == 0:
return (
Qt.Checked if self.my_data[index.row()][index.column() + 1]
else Qt.Unchecked)
示例6: data
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def data(self, index, rola=Qt.DisplayRole):
""" Wyświetlanie danych """
i = index.row()
j = index.column()
if rola == Qt.DisplayRole:
return '{0}'.format(self.tabela[i][j])
elif rola == Qt.CheckStateRole and (j == 3 or j == 4):
if self.tabela[i][j]:
return Qt.Checked
else:
return Qt.Unchecked
elif rola == Qt.EditRole and j == 1:
return self.tabela[i][j]
else:
return QVariant()
示例7: behavior_item_clicked
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def behavior_item_clicked(self, item):
"""
check / uncheck behaviors belonging to the clicked category
"""
if item.data(33) == "category":
category = item.data(34)
for i in range(self.lwBehaviors.count()):
if self.lwBehaviors.item(i).data(34) == category and self.lwBehaviors.item(i).data(33) != "category":
if item.data(35):
self.lwBehaviors.item(i).setCheckState(Qt.Unchecked)
else:
self.lwBehaviors.item(i).setCheckState(Qt.Checked)
item.setData(35, not item.data(35))
示例8: cb_changed
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def cb_changed(self):
selectedSubjects = []
for idx in range(self.lwSubjects.count()):
cb = self.lwSubjects.itemWidget(self.lwSubjects.item(idx))
if cb and cb.isChecked():
selectedSubjects.append(cb.text())
# FIX ME
observedBehaviors = self.extract_observed_behaviors(self.selectedObservations, selectedSubjects)
logging.debug(f"observed behaviors: {observedBehaviors}")
for idx in range(self.lwBehaviors.count()):
if self.lwBehaviors.item(idx).data(33) != "category":
if self.lwBehaviors.item(idx).text() in observedBehaviors:
self.lwBehaviors.item(idx).setCheckState(Qt.Checked)
else:
self.lwBehaviors.item(idx).setCheckState(Qt.Unchecked)
示例9: data
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def data(self, index: QModelIndex, role=None):
row = index.row()
if role == Qt.DisplayRole:
if row == 0:
return "not assigned"
else:
try:
return str(self.participants[row-1])
except IndexError:
return None
elif role == Qt.CheckStateRole:
if row == 0:
return Qt.Checked if self.show_unassigned else Qt.Unchecked
else:
try:
return Qt.Checked if self.participants[row-1].show else Qt.Unchecked
except IndexError:
return None
示例10: add_items
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def add_items(self):
if self.feature_dict:
for key in self.feature_dict.keys():
root = QTreeWidgetItem(self, [key])
for type_t in self.feature_dict[key]:
feature = QTreeWidgetItem(root, ['Feature Types'])
feature.setData(0, Qt.EditRole, type_t)
feature.setCheckState(1, Qt.Unchecked)
self.resizeColumnToContents(0)
self.resizeColumnToContents(1)
self.is_ready = True
self.expandAll()
示例11: fill_item
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def fill_item(item, value):
global n
# item.setExpanded(True)
if type(value) is dict:
for key, val in sorted(value.items()):
child = QTreeWidgetItem()
child.setText(0, str(key))
child.setText(1, str(key))
child.setText(2, str(key))
child.setFlags(child.flags() | Qt.ItemIsUserCheckable)
child.setCheckState(0, Qt.Unchecked)
item.addChild(child)
n += 1
fill_item(child, val)
elif type(value) is list:
for val in value:
child = QTreeWidgetItem()
child.setFlags(child.flags() | Qt.ItemIsUserCheckable)
child.setCheckState(0, Qt.Unchecked)
item.addChild(child)
n += 1
if type(val) is dict:
child.setText(0, "[dict]")
fill_item(child, val)
elif type(val) is list:
child.setText(0, "[list]")
fill_item(child, val)
else:
child.setText(0, str(val))
else:
child = QTreeWidgetItem()
child.setText(0, str(value))
child.setFlags(child.flags() | Qt.ItemIsUserCheckable)
child.setCheckState(0, Qt.Unchecked)
item.addChild(child)
n += 1
示例12: on_chkWavShow_stateChanged
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def on_chkWavShow_stateChanged(self, state):
self.ChartView.setVisible(state == Qt.Checked)
self.txtMain.setVisible(state == Qt.Unchecked)
示例13: queueChanged
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def queueChanged(self, combo):
# if one of the queues selected by user , start time and end time must
# be deactivated
if self.add_queue_comboBox.currentIndex() != 0:
self.start_checkBox.setCheckState(Qt.Unchecked)
self.start_checkBox.setEnabled(False)
self.end_checkBox.setCheckState(Qt.Unchecked)
self.end_checkBox.setEnabled(False)
else:
self.start_checkBox.setEnabled(True)
self.end_checkBox.setEnabled(True)
示例14: deselectAll
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def deselectAll(self, button):
for i in range(self.links_table.rowCount()):
item = self.links_table.item(i, 0)
item.setCheckState(Qt.Unchecked)
# this method is called, when user changes add_queue_comboBox
示例15: queueChanged
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import Unchecked [as 别名]
def queueChanged(self, combo):
# if one of the queues selected by user , start time and end time must
# be deactivated
if self.add_queue_comboBox.currentIndex() != 0:
self.start_checkBox.setCheckState(Qt.Unchecked)
self.start_checkBox.setEnabled(False)
self.end_checkBox.setCheckState(Qt.Unchecked)
self.end_checkBox.setEnabled(False)
else:
self.start_checkBox.setEnabled(True)
self.end_checkBox.setEnabled(True)