本文整理汇总了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
示例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
示例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)
示例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()
示例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)
示例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
示例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)
示例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)
示例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)
示例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))
示例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
)