mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
sip6 converts all enums to python Enums, but ONLY creates Enums with IntFlags types when the c++ type is an enum class : int. Accordingly we need to patch back in all the operations which treat enum values as ints, like |, &, bool, etc. The long term solution here is to move all our c++ enums to enum class, but that's not always straightforward and can break API for plugins if it involves the signature of virtual methods.
11 lines
737 B
Python
11 lines
737 B
Python
# The following has been generated automatically from src/core/processing/qgsprocessingprovider.h
|
|
QgsProcessingProvider.FlagDeemphasiseSearchResults = QgsProcessingProvider.Flag.FlagDeemphasiseSearchResults
|
|
QgsProcessingProvider.Flags = lambda flags=0: QgsProcessingProvider.Flag(flags)
|
|
_force_int = lambda v: v if isinstance(v, int) else int(v.value)
|
|
|
|
|
|
QgsProcessingProvider.Flag.__bool__ = lambda flag: _force_int(flag)
|
|
QgsProcessingProvider.Flag.__eq__ = lambda flag1, flag2: _force_int(flag1) == _force_int(flag2)
|
|
QgsProcessingProvider.Flag.__and__ = lambda flag1, flag2: _force_int(flag1) & _force_int(flag2)
|
|
QgsProcessingProvider.Flag.__or__ = lambda flag1, flag2: QgsProcessingProvider.Flag(_force_int(flag1) | _force_int(flag2))
|