當前位置: 首頁>>代碼示例>>Python>>正文


Python Qt.Checked方法代碼示例

本文整理匯總了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) 
開發者ID:pyCGNS,項目名稱:pyCGNS,代碼行數:24,代碼來源:wtree.py

示例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) 
開發者ID:pyCGNS,項目名稱:pyCGNS,代碼行數:18,代碼來源:wquery.py

示例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 
開發者ID:pyCGNS,項目名稱:pyCGNS,代碼行數:19,代碼來源:wquery.py

示例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() 
開發者ID:spyder-ide,項目名稱:conda-manager,代碼行數:18,代碼來源:channels.py

示例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() 
開發者ID:spyder-ide,項目名稱:conda-manager,代碼行數:25,代碼來源:channels.py

示例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 
開發者ID:busimus,項目名稱:cutelog,代碼行數:13,代碼來源:logger_table_header.py

示例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() 
開發者ID:napari,項目名稱:napari,代碼行數:14,代碼來源:qt_viewer_buttons.py

示例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 
開發者ID:napari,項目名稱:napari,代碼行數:14,代碼來源:qt_viewer_buttons.py

示例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 
開發者ID:napari,項目名稱:napari,代碼行數:14,代碼來源:qt_points_layer.py

示例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 
開發者ID:napari,項目名稱:napari,代碼行數:14,代碼來源:qt_labels_layer.py

示例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() 
開發者ID:pyCGNS,項目名稱:pyCGNS,代碼行數:29,代碼來源:woption.py

示例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]]) 
開發者ID:pyCGNS,項目名稱:pyCGNS,代碼行數:41,代碼來源:wquery.py

示例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) 
開發者ID:pyCGNS,項目名稱:pyCGNS,代碼行數:11,代碼來源:wquery.py

示例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) 
開發者ID:pyCGNS,項目名稱:pyCGNS,代碼行數:16,代碼來源:winfo.py

示例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) 
開發者ID:KmolYuan,項目名稱:Pyslvs-UI,代碼行數:34,代碼來源:output_option.py


注:本文中的qtpy.QtCore.Qt.Checked方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。