QGIS/python/PyQt6/core/auto_additions/qgsprocessingprovider.py
Nyall Dawson 85b7a2c411 [sipify] Patch support for int based enum operations on non-enum class ints
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.
2024-01-29 04:23:44 +10:00

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))