Python PyQt4.QtCore.Qt 模块,Checked() 实例源码

我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用PyQt4.QtCore.Qt.Checked()

项目:QGIS-CKAN-Browser    作者:BergWerkGIS    | 项目源码 | 文件源码
def window_loaded(self):
        try:
            self.util.msg_log('window_loaded')
            self.util.msg_log('before stop')
            self.timer.stop()
            self.timer = None
            self.util.msg_log('before get_groupds')
            ok, result = self.cc.get_groups()
            if ok is False:
                QApplication.restoreOverrideCursor()
                self.util.dlg_warning(result)
                return

            if not result:
                self.list_all_clicked()
            else:
                for entry in result:
                    item = QListWidgetItem(entry['display_name'])
                    item.setData(Qt.UserRole, entry)
                    #item.setCheckState(Qt.Checked)
                    item.setCheckState(Qt.Unchecked)
                    self.IDC_listGroup.addItem(item)
        finally:
            QApplication.restoreOverrideCursor()
项目:batch_gps_importer    作者:wondie    | 项目源码 | 文件源码
def on_fields_group_box_toggled(self):
        """
        A slot raised when the fields group box is checked or unchecked.
        Removes the selection from all fields when unchecked and selects all
        fields when checked.
        """
        for text, column in self.field_items.iteritems():
            items = self.exclude_fields_view.model().findItems(
                text, Qt.MatchExactly, column
            )
            for item in items:
                if self.exclude_fields_groupbox.isChecked():
                    item.setCheckState(Qt.Checked)
                else:
                    item.setCheckState(Qt.Unchecked)
项目:QGIS-CKAN-Browser    作者:BergWerkGIS    | 项目源码 | 文件源码
def __get_selected_groups(self):
        groups = []
        for i in range(0, self.IDC_listGroup.count()):
            item = self.IDC_listGroup.item(i)
            if item.checkState() == Qt.Checked:
                groups.append(item.data(Qt.UserRole)['name'])

        # None: means search all groups
        if len(groups) < 1 or len(groups) == self.IDC_listGroup.count():
            return None
        return groups
项目:QGIS-CKAN-Browser    作者:BergWerkGIS    | 项目源码 | 文件源码
def __get_selected_resources(self):
        res = []
        for i in range(0, self.IDC_listRessources.count()):
            item = self.IDC_listRessources.item(i)
            if item.checkState() == Qt.Checked:
                res.append(item.data(Qt.UserRole))

        if len(res) < 1:
            return None
        return res
项目:ee-book    作者:ee-book    | 项目源码 | 文件源码
def set_pw_echo_mode(self, state):
        self.password.setEchoMode(self.password.Normal if state == Qt.Checked else self.password.Password)
项目:rexploit    作者:DaniLabs    | 项目源码 | 文件源码
def setCheckBoxVulnerableChecked(self, checked=True):
        """
        This function changes checkbox's state
        :param checked: True or False
        :return: None
        """
        if checked:
            self.checkBoxVulnerable.setCheckState(Qt.Checked)
        else:
            self.checkBoxVulnerable.setCheckState(Qt.Unchecked)