当前位置: 首页>>代码示例>>Python>>正文


Python Qt.Unchecked方法代码示例

本文整理汇总了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 = [] 
开发者ID:qkitgroup,项目名称:qkit,代码行数:26,代码来源:main.py

示例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) 
开发者ID:Oslandia,项目名称:qgis-versioning,代码行数:25,代码来源:plugin.py

示例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() 
开发者ID:Thomasedv,项目名称:Grabber,代码行数:23,代码来源:parameter_tree.py

示例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) 
开发者ID:Thomasedv,项目名称:Grabber,代码行数:22,代码来源:parameter_tree.py

示例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) 
开发者ID:jprouty,项目名称:mint-amazon-tagger,代码行数:19,代码来源:qt.py

示例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() 
开发者ID:koduj-z-klasa,项目名称:python101,代码行数:18,代码来源:tabmodel_z5.py

示例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)) 
开发者ID:olivierfriard,项目名称:BORIS,代码行数:18,代码来源:param_panel.py

示例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) 
开发者ID:olivierfriard,项目名称:BORIS,代码行数:21,代码来源:param_panel.py

示例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 
开发者ID:jopohl,项目名称:urh,代码行数:21,代码来源:ParticipantListModel.py

示例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() 
开发者ID:MTG,项目名称:dunya-desktop,代码行数:15,代码来源:treewidget.py

示例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 
开发者ID:Mebus,项目名称:restatic,代码行数:38,代码来源:extract_dialog.py

示例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) 
开发者ID:XIVN1987,项目名称:JRTTView,代码行数:5,代码来源:RTTView.py

示例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) 
开发者ID:persepolisdm,项目名称:persepolis,代码行数:14,代码来源:properties.py

示例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 
开发者ID:persepolisdm,项目名称:persepolis,代码行数:8,代码来源:browser_plugin_queue.py

示例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) 
开发者ID:persepolisdm,项目名称:persepolis,代码行数:15,代码来源:addlink.py


注:本文中的PyQt5.QtCore.Qt.Unchecked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。