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


Python Qt.Unchecked方法代碼示例

本文整理匯總了Python中qgis.PyQt.QtCore.Qt.Unchecked方法的典型用法代碼示例。如果您正苦於以下問題:Python Qt.Unchecked方法的具體用法?Python Qt.Unchecked怎麽用?Python Qt.Unchecked使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在qgis.PyQt.QtCore.Qt的用法示例。


在下文中一共展示了Qt.Unchecked方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: validateCurrentPage

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def validateCurrentPage(self):
        if self.currentId() == 0:
            if self.importRadioButton.checkState() == Qt.Unchecked() and self.createNewRadioButton.checkState() == Qt.Unchecked() and self.installRadioButton.checkState() == Qt.Unchecked():
                errorMsg = self.tr('An option must be chosen!\n')
                QMessageBox.warning(self, self.tr('Error!'), errorMsg)
                return False
            if self.installRadioButton.checkState() == Qt.Checked():
                if self.settingComboBox.currentIndex() == 0:
                    errorMsg = self.tr('A setting must be chosen!\n')
                    QMessageBox.warning(self, self.tr('Error!'), errorMsg)
                    return False
                else:
                    return True
            return True
        else:
            return True 
開發者ID:dsgoficial,項目名稱:DsgTools,代碼行數:18,代碼來源:selectTaskWizard.py

示例2: setEditorData

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def setEditorData(self, editor, index):
        """
        load data from model to editor
        """
        m = index.model()
        try:
            if index.column() == self.column:
                txt = m.data(index, Qt.DisplayRole)
                checkList = txt[1:-1].split(',')
                for i in range(editor.count()):
                    item = editor.item(i)
                    item.setCheckState(Qt.Checked if item.text() in checkList else Qt.Unchecked)
            else:
                # use default
                QItemDelegate.setEditorData(self, editor, index)
        except:
            pass 
開發者ID:dsgoficial,項目名稱:DsgTools,代碼行數:19,代碼來源:manageComplex.py

示例3: clearAll

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def clearAll(self):
        cnt = self.model.rowCount()
        for i in range(0, cnt):
            item = self.model.item(i)
            item.setCheckState(Qt.Unchecked) 
開發者ID:NationalSecurityAgency,項目名稱:qgis-kmltools-plugin,代碼行數:7,代碼來源:htmlExpansionDialog.py

示例4: toggle_menu_triggered

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def toggle_menu_triggered(self, action):
        """
        Toggles usae of layers
        :param action: the menu action that triggered this
        """
        sync_action = SyncAction.NO_ACTION
        if action in (self.remove_hidden_action, self.remove_all_action):
            sync_action = SyncAction.REMOVE
        elif action in (self.add_all_offline_action, self.add_visible_offline_action):
            sync_action = SyncAction.OFFLINE

        # all layers
        if action in (self.remove_all_action, self.add_all_copy_action, self.add_all_offline_action):
            for i in range(self.layersTable.rowCount()):
                item = self.layersTable.item(i, 0)
                layer_source = item.data(Qt.UserRole)
                old_action = layer_source.action
                available_actions, _ = zip(*layer_source.available_actions)
                if sync_action in available_actions:
                    layer_source.action = sync_action
                    if layer_source.action != old_action:
                        self.project.setDirty(True)
                    layer_source.apply()
        # based on visibility
        elif action in (self.remove_hidden_action, self.add_visible_copy_action, self.add_visible_offline_action):
            visible = Qt.Unchecked if action == self.remove_hidden_action else Qt.Checked
            root = QgsProject.instance().layerTreeRoot()
            for layer in QgsProject.instance().mapLayers().values():
                node = root.findLayer(layer.id())
                if node and node.isVisible() == visible:
                    layer_source = LayerSource(layer)
                    old_action = layer_source.action
                    available_actions, _ = zip(*layer_source.available_actions)
                    if sync_action in available_actions:
                        layer_source.action = sync_action
                        if layer_source.action != old_action:
                            self.project.setDirty(True)
                        layer_source.apply()

        self.reloadProject() 
開發者ID:opengisch,項目名稱:qfieldsync,代碼行數:42,代碼來源:project_configuration_dialog.py

示例5: checkDelimiters

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def checkDelimiters(self, setupDict):
        """
        Check delimiters
        """
        for i in range(self.treeWidget.invisibleRootItem().childCount()):
            areaItem = self.treeWidget.invisibleRootItem().child(i)
            for j in range(self.treeWidget.invisibleRootItem().child(i).childCount()):
                delimiterItem = areaItem.child(j)
                if areaItem.text(0) in list(setupDict.keys()):
                    if delimiterItem.text(1) not in setupDict[areaItem.text(0)]:
                        delimiterItem.setCheckState(1,Qt.Unchecked) 
開發者ID:dsgoficial,項目名稱:DsgTools,代碼行數:13,代碼來源:setupEarthCoverage.py

示例6: setInterface

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def setInterface(self, parameterDict):
        """
        Sets the interface with a dict in the format:
        {
            'buttonColor':--color of the button--, 
            'buttonToolTip'--button toolTip--, 
            'buttonGroupTag':--group tag of the button--,
            'buttonShortcut':--shortcut for the button--,
            'openForm':--open feature form when digitizing--
        }
        """
        if 'buttonColor' in list(parameterDict.keys()):
            self.colorCheckBox.setCheckState(Qt.Checked)
            R,G,B,A = list(map(int,parameterDict['buttonColor'].split(','))) #QColor only accepts int values
            self.mColorButton.setColor(QColor(R,G,B,A))
        else:
            self.colorCheckBox.setCheckState(Qt.Unchecked) #if 'buttonColor' isn't on dict keys, set colorCheckBox as unchecked
        if 'buttonToolTip' in list(parameterDict.keys()):
            self.tooltipCheckBox.setCheckState(Qt.Checked)
            self.toolTipLineEdit.setText(parameterDict['buttonToolTip'])
        else:
            self.tooltipCheckBox.setCheckState(Qt.Unchecked) #if 'buttonToolTip' isn't on dict keys, set tooltipCheckBox as unchecked
            self.toolTipLineEdit.setText('')
        if 'buttonGroupTag' in list(parameterDict.keys()):
            self.customCategoryCheckBox.setCheckState(Qt.Checked)
            self.customCategoryLineEdit.setText(parameterDict['buttonGroupTag'])
        else:
            self.customCategoryCheckBox.setCheckState(Qt.Unchecked) #if 'buttonGroupTag' isn't on dict keys, set customCategoryCheckBox as unchecked
            self.customCategoryLineEdit.setText('')
        if 'buttonShortcut' in list(parameterDict.keys()):
            self.shortcutCheckBox.setCheckState(Qt.Checked)
            self.shortcutWidget.setShortcut(parameterDict['buttonShortcut'])
        else:
            self.shortcutCheckBox.setCheckState(Qt.Unchecked) #if 'buttonShortcut' isn't on dict keys, set shortcutCheckBox as unchecked
            self.shortcutWidget.clearAll()
        if 'openForm' in list(parameterDict.keys()):
            self.openFormCheckBox.setCheckState(Qt.Checked)
        else:
            self.openFormCheckBox.setCheckState(Qt.Unchecked) #if 'openForm' isn't on dict keys, set openFormCheckBox as unchecked 
開發者ID:dsgoficial,項目名稱:DsgTools,代碼行數:41,代碼來源:buttonPropWidget.py

示例7: createEditor

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def createEditor(self, parent, option, index):
        """
        Creates a custom editor to edit value relation data
        """
        # special combobox for field type
        if index.column() == self.column:
            list = QListWidget(parent)
            for item in self.itemsDict:
                listItem = QListWidgetItem(item)
                listItem.setCheckState(Qt.Unchecked)
                list.addItem(listItem)
            return list
        return QItemDelegate.createEditor(self, parent, option, index) 
開發者ID:dsgoficial,項目名稱:DsgTools,代碼行數:15,代碼來源:manageComplex.py

示例8: uncheckAll

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def uncheckAll(self):
        for row in range(0, self.rootItem.childCount()):
            groupItem = self.rootItem.child(row)
            groupIndex = self.createIndex(row, self.COLUMN_VISIBILITY, groupItem)
            self.setData(groupIndex, Qt.Unchecked, Qt.CheckStateRole) 
開發者ID:nextgis,項目名稱:quickmapservices,代碼行數:7,代碼來源:data_sources_model.py

示例9: saveSettings

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def saveSettings(self):
        hideDSidList = []
        for groupIndex in range(0, self.rootItem.childCount()):
            groupItem = self.rootItem.child(groupIndex)
            for dsIndex in range(0, groupItem.childCount()):
                dsItem = groupItem.child(dsIndex)
                if dsItem.checkState(self.COLUMN_VISIBILITY) == Qt.Unchecked:
                    hideDSidList.append(dsItem.data(self.COLUMN_GROUP_DS, Qt.UserRole).id)
        PluginSettings.set_hide_ds_id_list(hideDSidList) 
開發者ID:nextgis,項目名稱:quickmapservices,代碼行數:11,代碼來源:data_sources_model.py

示例10: readSettings

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def readSettings(self):
        '''Load the user selected settings. The settings are retained even when
        the user quits QGIS. This just loads the saved information into variables,
        but does not update the widgets. The widgets are updated with showEvent.'''
        qset = QSettings()

        ### CAPTURE SETTINGS ###
        self.captureShowLocation = int(qset.value('/LatLonTools/CaptureShowClickedLocation', Qt.Unchecked))
        self.captureCustomCrsAuthId = qset.value('/LatLonTools/CaptureCustomCrsId', 'EPSG:4326')
        self.captureGeohashPrecision = int(qset.value('/LatLonTools/CaptureGeohashPrecision', 12))
        self.captureDmmPrecision =  int(qset.value('/LatLonTools/CaptureDmmPrecision', 4))
        self.captureUtmPrecision =  int(qset.value('/LatLonTools/CaptureUtmPrecision', 0))
        self.captureAddDmsSpace = int(qset.value('/LatLonTools/CaptureAddDmsSpace', Qt.Checked))
        self.capturePadZeroes = int(qset.value('/LatLonTools/CapturePadZeroes', Qt.Unchecked))
        self.captureMaidenheadPrecision = int(qset.value('/LatLonTools/CaptureMaidenheadPrecision', 3))

        ### EXTERNAL MAP ###
        self.showPlacemark = int(qset.value('/LatLonTools/ShowPlacemark', Qt.Checked))
        self.mapProvider = int(qset.value('/LatLonTools/MapProvider', 0))
        self.mapProviderRight = int(qset.value('/LatLonTools/MapProviderRight', 0))
        self.mapZoom = int(qset.value('/LatLonTools/MapZoom', 13))
        self.externalMapShowLocation = int(qset.value('/LatLonTools/ExternMapShowClickedLocation', Qt.Unchecked))
        self.userMapProviders = qset.value('/LatLonTools/UserMapProviders', [])

        ### Multi-zoom Settings ###
        self.multiZoomCustomCrsAuthId = qset.value('/LatLonTools/MultiZoomCustomCrsId', 'EPSG:4326')

        ### BBOX CAPTURE SETTINGS ###
        self.bBoxCrs = int(qset.value('/LatLonTools/BBoxCrs', 0))  # Specifies WGS 84
        self.bBoxFormat = int(qset.value('/LatLonTools/BBoxFormat', 0))
        self.bBoxDelimiter = qset.value('/LatLonTools/BBoxDelimiter', ',')
        self.bBoxDigits = int(qset.value('/LatLonTools/BBoxDigits', 8))
        self.bBoxPrefix = qset.value('/LatLonTools/BBoxPrefix', '')
        self.bBoxSuffix = qset.value('/LatLonTools/BBoxSuffix', '')

        ### COORDINATE CONVERSION SETTINGS ###
        self.converterCustomCrsAuthId = qset.value('/LatLonTools/ConverterCustomCrsId', 'EPSG:4326')
        self.converterCoordOrder = int(qset.value('/LatLonTools/ConverterCoordOrder', self.OrderYX))
        self.converterDDPrec = int(qset.value('/LatLonTools/ConverterDDPrecision', 2))
        self.converter4326DDPrec = int(qset.value('/LatLonTools/Converter4326DDPrecision', 8))
        self.converterDmsPrec = int(qset.value('/LatLonTools/ConverterDmsPrecision', 0))
        self.converterDmmPrec = int(qset.value('/LatLonTools/ConverterDmmPrecision', 4))
        self.converterUtmPrec = int(qset.value('/LatLonTools/ConverterUtmPrecision', 0))
        self.converterPlusCodeLength = int(qset.value('/LatLonTools/ConverterPlusCodeLength', 10))
        self.converterGeohashPrecision = int(qset.value('/LatLonTools/ConverterGeohashPrecision', 12))
        self.converterMaidenheadPrecision = int(qset.value('/LatLonTools/ConverterMaidenheadPrecision', 3))
        self.converterDelimiter = qset.value('/LatLonTools/ConverterDelimiter', ', ')
        self.converterDdmmssDelimiter = qset.value('/LatLonTools/ConverterDdmmssDelimiter', ', ')
        self.converterAddDmsSpace = int(qset.value('/LatLonTools/ConverterAddDmsSpace', Qt.Checked))
        self.converterPadZeroes = int(qset.value('/LatLonTools/ConverterPadZeroes', Qt.Unchecked)) 
開發者ID:NationalSecurityAgency,項目名稱:qgis-latlontools-plugin,代碼行數:52,代碼來源:settings.py

示例11: __setupModelData

# 需要導入模塊: from qgis.PyQt.QtCore import Qt [as 別名]
# 或者: from qgis.PyQt.QtCore.Qt import Unchecked [as 別名]
def __setupModelData(self):
        dsList = DataSourcesList().data_sources.values()
        groupInfoList = GroupsList().groups
        groupsItems = []
        groups = []
        for ds in dsList:
            if ds.group in groups:
                group_item = groupsItems[groups.index(ds.group)]
            else:
                group_item = QTreeWidgetItem()
                group_item.setData(self.COLUMN_GROUP_DS, Qt.DisplayRole, ds.group)
                group_item.setData(self.COLUMN_VISIBILITY, Qt.DisplayRole, "")
                group_item.setData(self.COLUMN_SOURCE, Qt.DisplayRole, ds.category)
                group_item.setCheckState(self.COLUMN_VISIBILITY, Qt.Unchecked)

                groupInfo = groupInfoList.get(ds.group)
                if groupInfo is not None:
                    group_item.setIcon(self.COLUMN_GROUP_DS, QIcon(groupInfo.icon))
                else:
                    group_item.setData(self.COLUMN_GROUP_DS, Qt.DisplayRole, ds.group + " (%s!)" % self.tr("group not found"))
                group_item.setData(self.COLUMN_GROUP_DS, Qt.UserRole, groupInfo)

                groups.append(ds.group)
                groupsItems.append(group_item)
                self.rootItem.addChild(group_item)

            ds_item = QTreeWidgetItem()
            ds_item.setData(self.COLUMN_GROUP_DS, Qt.DisplayRole, ds.alias)
            ds_item.setIcon(self.COLUMN_GROUP_DS, QIcon(ds.icon_path))
            ds_item.setData(self.COLUMN_GROUP_DS, Qt.UserRole, ds)
            ds_item.setData(self.COLUMN_VISIBILITY, Qt.DisplayRole, "")
            ds_item.setData(self.COLUMN_SOURCE, Qt.DisplayRole, ds.category)

            ds_check_state = Qt.Checked
            if ds.id in PluginSettings.get_hide_ds_id_list():
                ds_check_state = Qt.Unchecked
            ds_item.setCheckState(self.COLUMN_VISIBILITY, ds_check_state)

            if group_item.childCount() != 0 and group_item.checkState(1) != ds_check_state:
                group_item.setCheckState(self.COLUMN_VISIBILITY, Qt.PartiallyChecked)
            else:
                group_item.setCheckState(self.COLUMN_VISIBILITY, ds_check_state)

            group_item.addChild(
                ds_item
            ) 
開發者ID:nextgis,項目名稱:quickmapservices,代碼行數:48,代碼來源:data_sources_model.py


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