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


Python Qt.PartiallyChecked方法代码示例

本文整理汇总了Python中PyQt5.QtCore.Qt.PartiallyChecked方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.PartiallyChecked方法的具体用法?Python Qt.PartiallyChecked怎么用?Python Qt.PartiallyChecked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore.Qt的用法示例。


在下文中一共展示了Qt.PartiallyChecked方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __GetFields

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import PartiallyChecked [as 别名]
def __GetFields(self, parent):
        fields = []
        for i in range(parent.childCount()):
            childItem = parent.child(i)

            # leaf
            if childItem.childCount() == 0:
                if childItem.checkState(0) == Qt.Checked:
                    field = self.__GetFieldByShowName(self._fields, childItem.text(0))
                    fields.append(field)
                continue
            
            if childItem.checkState(0) == Qt.Checked or childItem.checkState(0) == Qt.PartiallyChecked:
                field = self.__GetFields(childItem)
                fields.extend(field)

        return fields 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:19,代码来源:DyTreeWidget.py

示例2: __UpdateParent

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import PartiallyChecked [as 别名]
def __UpdateParent(self, child):
        parent = child.parent()
        if parent is None or parent is self: return


        partiallySelected = False
        selectedCount = 0
        childCount = parent.childCount()
        for i in range(childCount):
             childItem = parent.child(i)
             if childItem.checkState(0) == Qt.Checked:
                 selectedCount += 1
             elif childItem.checkState(0) == Qt.PartiallyChecked:
                 partiallySelected = True

        if partiallySelected:
            parent.setCheckState(0, Qt.PartiallyChecked)
        else:
            if selectedCount == 0:
                parent.setCheckState(0, Qt.Unchecked)
            elif selectedCount > 0 and selectedCount < childCount:
                parent.setCheckState(0, Qt.PartiallyChecked)
            else:
                parent.setCheckState(0, Qt.Checked)

        self.__UpdateParent(parent) 
开发者ID:moyuanz,项目名称:DevilYuan,代码行数:28,代码来源:DyTreeWidget.py

示例3: enable_check

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import PartiallyChecked [as 别名]
def enable_check(self, enabled):
        self.group.setCheckable(enabled)
        self.group.setChecked(False)

        self.noOutputCheckBox.setTristate(enabled)
        if enabled:
            self.noOutputCheckBox.setCheckState(Qt.PartiallyChecked)

        self.noErrorCheckBox.setTristate(enabled)
        if enabled:
            self.killCheckBox.setCheckState(Qt.PartiallyChecked)

        self.killCheckBox.setTristate(enabled)
        if enabled:
            self.killCheckBox.setCheckState(Qt.PartiallyChecked) 
开发者ID:FrancescoCeruti,项目名称:linux-show-player,代码行数:17,代码来源:command_cue.py

示例4: get_settings

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import PartiallyChecked [as 别名]
def get_settings(self):
        settings = {}

        if not (self.group.isCheckable() and not self.group.isChecked()):
            if self.commandLineEdit.text().strip():
                settings['command'] = self.commandLineEdit.text()
        if self.noOutputCheckBox.checkState() != Qt.PartiallyChecked:
            settings['no_output'] = self.noOutputCheckBox.isChecked()
        if self.noErrorCheckBox.checkState() != Qt.PartiallyChecked:
            settings['no_error'] = self.noErrorCheckBox.isChecked()
        if self.killCheckBox.checkState() != Qt.PartiallyChecked:
            settings['kill'] = self.killCheckBox.isChecked()

        return settings 
开发者ID:FrancescoCeruti,项目名称:linux-show-player,代码行数:16,代码来源:command_cue.py

示例5: group_check_state

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import PartiallyChecked [as 别名]
def group_check_state(self):
        if not self.is_group:
            return None

        if self.childCount() == 0:
            return Qt.Unchecked

        if all(child.show for child in self.children):
            return Qt.Checked
        elif any(child.show for child in self.children):
            return Qt.PartiallyChecked
        else:
            return Qt.Unchecked 
开发者ID:jopohl,项目名称:urh,代码行数:15,代码来源:ProtocolTreeItem.py


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