QGIS/python/PyQt6/gui/auto_additions/qgssearchwidgetwrapper.py
Nyall Dawson 1f27fc627a [pyqgis] Wrap unambiguously static methods in staticmethod
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.
2024-08-14 22:08:41 +10:00

35 lines
2.6 KiB
Python

# The following has been generated automatically from src/gui/editorwidgets/core/qgssearchwidgetwrapper.h
QgsSearchWidgetWrapper.EqualTo = QgsSearchWidgetWrapper.FilterFlag.EqualTo
QgsSearchWidgetWrapper.NotEqualTo = QgsSearchWidgetWrapper.FilterFlag.NotEqualTo
QgsSearchWidgetWrapper.GreaterThan = QgsSearchWidgetWrapper.FilterFlag.GreaterThan
QgsSearchWidgetWrapper.LessThan = QgsSearchWidgetWrapper.FilterFlag.LessThan
QgsSearchWidgetWrapper.GreaterThanOrEqualTo = QgsSearchWidgetWrapper.FilterFlag.GreaterThanOrEqualTo
QgsSearchWidgetWrapper.LessThanOrEqualTo = QgsSearchWidgetWrapper.FilterFlag.LessThanOrEqualTo
QgsSearchWidgetWrapper.Between = QgsSearchWidgetWrapper.FilterFlag.Between
QgsSearchWidgetWrapper.CaseInsensitive = QgsSearchWidgetWrapper.FilterFlag.CaseInsensitive
QgsSearchWidgetWrapper.Contains = QgsSearchWidgetWrapper.FilterFlag.Contains
QgsSearchWidgetWrapper.DoesNotContain = QgsSearchWidgetWrapper.FilterFlag.DoesNotContain
QgsSearchWidgetWrapper.IsNull = QgsSearchWidgetWrapper.FilterFlag.IsNull
QgsSearchWidgetWrapper.IsNotBetween = QgsSearchWidgetWrapper.FilterFlag.IsNotBetween
QgsSearchWidgetWrapper.IsNotNull = QgsSearchWidgetWrapper.FilterFlag.IsNotNull
QgsSearchWidgetWrapper.StartsWith = QgsSearchWidgetWrapper.FilterFlag.StartsWith
QgsSearchWidgetWrapper.EndsWith = QgsSearchWidgetWrapper.FilterFlag.EndsWith
QgsSearchWidgetWrapper.FilterFlags = lambda flags=0: QgsSearchWidgetWrapper.FilterFlag(flags)
from enum import Enum
def _force_int(v): return int(v.value) if isinstance(v, Enum) else v
QgsSearchWidgetWrapper.FilterFlag.__bool__ = lambda flag: bool(_force_int(flag))
QgsSearchWidgetWrapper.FilterFlag.__eq__ = lambda flag1, flag2: _force_int(flag1) == _force_int(flag2)
QgsSearchWidgetWrapper.FilterFlag.__and__ = lambda flag1, flag2: _force_int(flag1) & _force_int(flag2)
QgsSearchWidgetWrapper.FilterFlag.__or__ = lambda flag1, flag2: QgsSearchWidgetWrapper.FilterFlag(_force_int(flag1) | _force_int(flag2))
try:
QgsSearchWidgetWrapper.__attribute_docs__ = {'expressionChanged': 'Emitted whenever the expression changes\n\n:param exp: The new search expression\n', 'valueChanged': 'Emitted when a user changes the value of the search widget.\n', 'valueCleared': 'Emitted when a user changes the value of the search widget back\nto an empty, default state.\n'}
except NameError:
pass
QgsSearchWidgetWrapper.exclusiveFilterFlags = staticmethod(QgsSearchWidgetWrapper.exclusiveFilterFlags)
QgsSearchWidgetWrapper.nonExclusiveFilterFlags = staticmethod(QgsSearchWidgetWrapper.nonExclusiveFilterFlags)
QgsSearchWidgetWrapper.toString = staticmethod(QgsSearchWidgetWrapper.toString)