本文整理汇总了Python中qtpy.QtCore.Qt.Checked方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Checked方法的具体用法?Python Qt.Checked怎么用?Python Qt.Checked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtpy.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.Checked方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: linkselectdst
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def linkselectdst(self):
if (self.getLastEntered() is None): return
node = self.getLastEntered()
if (node is None): return
if (node.sidsIsLink()): return
if (node.sidsType() == CGK.CGNSTree_ts): return
if (self._control.selectForLinkDst is not None):
bt = self._control.selectForLinkDst[-1].bSelectLinkDst
bt.setChecked(Qt.Unchecked)
if (self._control.selectForLinkDst[-1] == self):
self._control.selectForLinkDst = None
return
self._control.selectForLinkDst = (node, node.sidsPath(),
self.FG.filedir,
self.FG.filename,
self)
self.bSelectLinkDst.setChecked(Qt.Checked)
if (self._linkwindow is not None):
n = node.sidsPath()
d = self.FG.filedir
f = self.FG.filename
self._linkwindow.updateSelected(d, f, n)
示例2: queryCommit
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def queryCommit(self):
self._modified = True
q = self.cQueryName.currentText()
if q not in Q7Query._allQueries:
self.queryAdd()
com = self.eText.toPlainText()
doc = self.eQueryDoc.toPlainText()
if self.cRequireUpdate.checkState() == Qt.Checked:
self.setRequireTreeUpdate(True)
else:
self.setRequireTreeUpdate(False)
Q7Query._allQueries[q].setScript(com)
Q7Query._allQueries[q].setDoc(doc)
self.bRevert.setEnabled(False)
self.bCommitDoc.setEnabled(False)
self.bRevertDoc.setEnabled(False)
示例3: showQuery
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def showQuery(self, name=None):
pstate = self._modified
if name is None:
name = self.getCurrentQuery().name
if name in Q7Query.queriesNamesList():
txt = self.getCurrentQuery().script
self.eText.initText(txt)
doc = self.getCurrentQuery().doc
self.eQueryDoc.initText(doc)
if self.getCurrentQuery().requireTreeUpdate():
self.cRequireUpdate.setCheckState(Qt.Checked)
else:
self.cRequireUpdate.setCheckState(Qt.Unchecked)
self.bRevert.setEnabled(False)
self.bCommitDoc.setEnabled(False)
self.bRevertDoc.setEnabled(False)
self._modified = pstate
示例4: setup
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def setup(self):
for channel in sorted(self._channels):
item = ListWidgetItemChannels(channel, self.list)
item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
if channel in self._active_channels:
item.setCheckState(Qt.Checked)
else:
item.setCheckState(Qt.Unchecked)
self.list.addItem(item)
item.setSizeHint(QSize(item.sizeHint().width(), self._height()))
self.list.setCurrentRow(0)
self.refresh()
self.set_tab_order()
示例5: update_channels
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def update_channels(self):
"""
"""
temp_active_channels = []
channels = []
for i in range(self.list.count()):
item = self.list.item(i)
channel = item.data(Qt.DisplayRole)
if channel:
channels.append(channel)
if item.checkState() == Qt.Checked:
temp_active_channels.append(item.data(Qt.DisplayRole))
if (sorted(channels) != sorted(self._channels) or
sorted(temp_active_channels) != sorted(self._active_channels)):
self.sig_channels_updated.emit(tuple(channels),
tuple(temp_active_channels))
self.accept()
else:
self.reject()
示例6: data
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def data(self, role):
if role == Qt.DisplayRole:
return self.column.title
elif role == Qt.ToolTipRole:
return self.column.name
elif role == Qt.CheckStateRole:
if self.column.visible:
return Qt.Checked
else:
return Qt.Unchecked
return None
示例7: change_grid
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def change_grid(self, state):
"""Toggle between grid view mode and (the ordinary) stack view mode.
Parameters
----------
event : qtpy.QtCore.QEvent
Event from the Qt context.
"""
if state == Qt.Checked:
self.viewer.stack_view()
else:
self.viewer.grid_view()
示例8: change_ndisplay
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def change_ndisplay(self, state):
"""Toggle between 2D and 3D display.
Parameters
----------
state : bool
If state is True the display view is 3D, if False display is 2D.
"""
if state == Qt.Checked:
self.viewer.dims.ndisplay = 3
else:
self.viewer.dims.ndisplay = 2
示例9: change_ndim
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def change_ndim(self, state):
"""Toggle n-dimensional state of label layer.
Parameters
----------
state : QCheckBox
Checkbox indicating if label layer is n-dimensional.
"""
if state == Qt.Checked:
self.layer.n_dimensional = True
else:
self.layer.n_dimensional = False
示例10: change_contig
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def change_contig(self, state):
"""Toggle contiguous state of label layer.
Parameters
----------
state : QCheckBox
Checkbox indicating if labels are contiguous.
"""
if state == Qt.Checked:
self.layer.contiguous = True
else:
self.layer.contiguous = False
示例11: reset
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def reset(self):
self.getOptions()
data = self._options
for k in data:
if (k[0] != '_') and (self.getopt(k) is not None):
setattr(OCTXT, k, data[k])
if self.getopt(k).objectName() in Q7Option.combos:
pass
elif isinstance(data[k], bool):
if data[k]:
self.getopt(k).setCheckState(Qt.Checked)
else:
self.getopt(k).setCheckState(Qt.Unchecked)
elif isinstance(data[k], int):
self.getopt(k).setValue(data[k])
elif isinstance(data[k], str):
try:
self.getopt(k).setText(data[k])
except AttributeError:
pass # self.getopt(k).setEditText(data[k])
elif isinstance(data[k], list):
s = ''
for l in data[k]:
s += '%s\n' % l
self.getopt(k).setPlainText(s)
self.checkDeps()
self.updateFonts()
示例12: setModelData
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def setModelData(self, editor, model, index):
col = self._lastCol
if col is None:
return
value = None
nodelist = []
dt = self._parent._data
if self._mode == CELLCOMBO:
value = editor.currentText()
if self._mode == CELLTEXT:
value = editor.text()
if self._parent.setToAll():
reply = MSG.wQuestion(self._parent, 371, 'Apply changes to all...',
"""The same value is going to be set to all selected nodes,<br>
Do we continue and perform the modification on all selected?<br>
This may fail on some nodes if the data type is not the same
as the original node for example. In that case some of the
nodes would be modified but not the others, you would not
have any status on the actual result of the modification.<br>
""")
if reply == MSG.OK:
for rw in self._parent.selectedRows():
nd = self._model.nodeFromPath(dt[rw])
nodelist.append((rw, nd))
else:
return
else:
nodelist.append((index.row(),
self._model.nodeFromPath(dt[index.row()])))
if self._parent.cForce.checkState() != Qt.Checked:
noforce = True
else:
noforce = False
for ndr in nodelist:
nix = self._model.createIndex(ndr[0], col, ndr[1])
if noforce:
nix.internalPointer().setEditCheck(False)
self._model.setData(nix, value, role=Qt.EditRole)
self._parent.updateRowData(ndr[0], dt[ndr[0]])
示例13: colCheck
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def colCheck(self):
if self.cShowPath.checkState() == Qt.Checked:
self._tb.showColumn(0)
else:
self._tb.hideColumn(0)
if self.cShowSIDS.checkState() == Qt.Checked:
self._tb.showColumn(2)
else:
self._tb.hideColumn(2)
示例14: reset
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def reset(self):
for k in dir(self):
if k in self._data:
v = self._data[k]
if isinstance(v, bool):
getattr(self, k).setEnabled(True)
if v:
getattr(self, k).setCheckState(Qt.Checked)
else:
getattr(self, k).setCheckState(Qt.Unchecked)
getattr(self, k).setEnabled(False)
if isinstance(v, (str, bytes, int, float)):
getattr(self, k).setText(str(v))
# getattr(self,k).setFont(OCTXT.FixedFontTable)
示例15: __init__
# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import Checked [as 别名]
def __init__(self, *args):
"""Type name: "DXF module"."""
super(DxfOutputDialog, self).__init__(*args)
# DXF version option.
version_label = QLabel("DXF version:", self)
self.version_option = QComboBox(self)
self.version_option.addItems(sorted((
f"{name} - {DXF_VERSIONS_MAP[name]}" for name in DXF_VERSIONS
), key=lambda v: v.split()[-1]))
self.version_option.setCurrentIndex(self.version_option.count() - 1)
self.version_option.setSizePolicy(QSizePolicy.Expanding,
QSizePolicy.Preferred)
dxf_version_layout = QHBoxLayout()
dxf_version_layout.addWidget(version_label)
dxf_version_layout.addWidget(self.version_option)
self.main_layout.insertLayout(3, dxf_version_layout)
# Parts interval.
self.interval_enable = QCheckBox("Parts interval:", self)
self.interval_enable.setCheckState(Qt.Checked)
self.interval_enable.setSizePolicy(QSizePolicy.Fixed,
QSizePolicy.Preferred)
self.interval_option = QDoubleSpinBox(self)
self.interval_option.setValue(10)
self.interval_enable.stateChanged.connect(
self.interval_option.setEnabled)
dxf_interval_layout = QHBoxLayout()
dxf_interval_layout.addWidget(self.interval_enable)
dxf_interval_layout.addWidget(self.interval_option)
dxf_interval_layout.addItem(
QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Preferred)
)
self.assembly_layout.insertLayout(2, dxf_interval_layout)