mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
use a custom type id for python implementation
otherwise, QgsSettingsEditorWidgetRegistry is creating a wrapper for this setting type and expects the cpp implemetnation (QgsSettingsEntryBaseTemplate and not QgsSettingsEntryBase)
This commit is contained in:
parent
1aa9a9ae6e
commit
08aeb133a0
@ -59,6 +59,15 @@ class PyQgsSettingsEntryEnumFlag(QgsSettingsEntryBase):
|
||||
parent = pluginName
|
||||
super().__init__(key, parent, defaultValueStr, description, options)
|
||||
|
||||
def metaEnum(self):
|
||||
return self.__metaEnum
|
||||
|
||||
def typeId(self):
|
||||
"""
|
||||
Defines a custom id since this class has not the same API as the cpp implementation
|
||||
"""
|
||||
return "py-enumflag"
|
||||
|
||||
def value(self, dynamicKeyPart=None):
|
||||
"""
|
||||
Get settings value.
|
||||
@ -138,5 +147,4 @@ class PyQgsSettingsEntryEnumFlag(QgsSettingsEntryBase):
|
||||
"""
|
||||
Get the settings entry type.
|
||||
"""
|
||||
|
||||
return self.SettingsType.EnumFlag
|
||||
|
@ -59,6 +59,15 @@ class PyQgsSettingsEntryEnumFlag(QgsSettingsEntryBase):
|
||||
parent = pluginName
|
||||
super().__init__(key, parent, defaultValueStr, description, options)
|
||||
|
||||
def metaEnum(self):
|
||||
return self.__metaEnum
|
||||
|
||||
def typeId(self):
|
||||
"""
|
||||
Defines a custom id since this class has not the same API as the cpp implementation
|
||||
"""
|
||||
return "py-enumflag"
|
||||
|
||||
def value(self, dynamicKeyPart=None):
|
||||
"""
|
||||
Get settings value.
|
||||
@ -138,5 +147,4 @@ class PyQgsSettingsEntryEnumFlag(QgsSettingsEntryBase):
|
||||
"""
|
||||
Get the settings entry type.
|
||||
"""
|
||||
|
||||
return self.SettingsType.EnumFlag
|
||||
|
Loading…
x
Reference in New Issue
Block a user