mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -04:00
sip doesn't use the standard Python staticmethod type for defining static methods, which means that standard means of testing for a static method (like `isinstance(..., staticmethod)`) fail with any PyQGIS static methods. This causes issues with lint tools, which incorrectly flag calls to QGIS static methods as missing self arguments. It also breaks detection of static methods in the sphinx PyQGIS docs, so all static methods are shown as non-static. Work around this in sipify, by wrapping unambiguously static methods in staticmethod wrappers.
31 lines
2.5 KiB
Python
31 lines
2.5 KiB
Python
# The following has been generated automatically from src/core/layout/qgslayoutitemmap.h
|
|
QgsLayoutItemMap.Fixed = QgsLayoutItemMap.AtlasScalingMode.Fixed
|
|
QgsLayoutItemMap.Predefined = QgsLayoutItemMap.AtlasScalingMode.Predefined
|
|
QgsLayoutItemMap.Auto = QgsLayoutItemMap.AtlasScalingMode.Auto
|
|
QgsLayoutItemMap.ShowPartialLabels = QgsLayoutItemMap.MapItemFlag.ShowPartialLabels
|
|
QgsLayoutItemMap.ShowUnplacedLabels = QgsLayoutItemMap.MapItemFlag.ShowUnplacedLabels
|
|
QgsLayoutItemMap.MapItemFlags = lambda flags=0: QgsLayoutItemMap.MapItemFlag(flags)
|
|
from enum import Enum
|
|
|
|
|
|
def _force_int(v): return int(v.value) if isinstance(v, Enum) else v
|
|
|
|
|
|
QgsLayoutItemMap.MapItemFlag.__bool__ = lambda flag: bool(_force_int(flag))
|
|
QgsLayoutItemMap.MapItemFlag.__eq__ = lambda flag1, flag2: _force_int(flag1) == _force_int(flag2)
|
|
QgsLayoutItemMap.MapItemFlag.__and__ = lambda flag1, flag2: _force_int(flag1) & _force_int(flag2)
|
|
QgsLayoutItemMap.MapItemFlag.__or__ = lambda flag1, flag2: QgsLayoutItemMap.MapItemFlag(_force_int(flag1) | _force_int(flag2))
|
|
try:
|
|
QgsLayoutItemMapAtlasClippingSettings.__attribute_docs__ = {'changed': 'Emitted when the atlas clipping settings are changed.\n'}
|
|
except NameError:
|
|
pass
|
|
try:
|
|
QgsLayoutItemMapItemClipPathSettings.__attribute_docs__ = {'changed': 'Emitted when the item clipping settings are changed.\n'}
|
|
except NameError:
|
|
pass
|
|
try:
|
|
QgsLayoutItemMap.__attribute_docs__ = {'extentChanged': "Emitted when the map's extent changes.\n\n.. seealso:: :py:func:`setExtent`\n\n.. seealso:: :py:func:`extent`\n", 'mapRotationChanged': "Emitted when the map's rotation changes.\n\n.. seealso:: :py:func:`setMapRotation`\n\n.. seealso:: :py:func:`mapRotation`\n", 'preparedForAtlas': 'Emitted when the map has been prepared for atlas rendering, just before actual rendering\n', 'layerStyleOverridesChanged': 'Emitted when layer style overrides are changed... a means to let\nassociated legend items know they should update\n', 'themeChanged': "Emitted when the map's associated ``theme`` is changed.\n\n.. note::\n\n This signal is not emitted when the definition of the theme changes, only the map\n is linked to a different theme then it previously was.\n\n.. versionadded:: 3.14\n", 'crsChanged': "Emitted when the map's coordinate reference system is changed.\n\n.. versionadded:: 3.18\n", 'previewRefreshed': "Emitted whenever the item's map preview has been refreshed.\n\n.. versionadded:: 3.20\n"}
|
|
except NameError:
|
|
pass
|
|
QgsLayoutItemMap.create = staticmethod(QgsLayoutItemMap.create)
|