mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-20 00:06:36 -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.
14 lines
1011 B
Python
14 lines
1011 B
Python
# The following has been generated automatically from src/gui/processing/models/qgsmodelcomponentgraphicitem.h
|
|
QgsModelComponentGraphicItem.Normal = QgsModelComponentGraphicItem.State.Normal
|
|
QgsModelComponentGraphicItem.Selected = QgsModelComponentGraphicItem.State.Selected
|
|
QgsModelComponentGraphicItem.Hover = QgsModelComponentGraphicItem.State.Hover
|
|
QgsModelComponentGraphicItem.Unused = QgsModelComponentGraphicItem.Flag.Unused
|
|
QgsModelComponentGraphicItem.Flags = lambda flags=0: QgsModelComponentGraphicItem.Flag(flags)
|
|
_force_int = lambda v: v if isinstance(v, int) else int(v.value)
|
|
|
|
|
|
QgsModelComponentGraphicItem.Flag.__bool__ = lambda flag: _force_int(flag)
|
|
QgsModelComponentGraphicItem.Flag.__eq__ = lambda flag1, flag2: _force_int(flag1) == _force_int(flag2)
|
|
QgsModelComponentGraphicItem.Flag.__and__ = lambda flag1, flag2: _force_int(flag1) & _force_int(flag2)
|
|
QgsModelComponentGraphicItem.Flag.__or__ = lambda flag1, flag2: QgsModelComponentGraphicItem.Flag(_force_int(flag1) | _force_int(flag2))
|