QGIS/python/PyQt6/gui/auto_additions/qgsattributetablemodel.py
Nyall Dawson 50408edac6
Fix PyQGIS docstrings for monkey patched enum values
We should be using the new name for the enum value instead
of the old one in the enum class docstring.

Move the old compatible name to an extra note
"Available as ``xx.yy`` in older QGIS releases."

Fixes #49171
2024-09-02 11:43:23 +10:00

56 lines
2.4 KiB
Python

# The following has been generated automatically from src/gui/attributetable/qgsattributetablemodel.h
QgsAttributeTableModel.Role = QgsAttributeTableModel.CustomRole
# monkey patching scoped based enum
QgsAttributeTableModel.FeatureIdRole = QgsAttributeTableModel.CustomRole.FeatureId
QgsAttributeTableModel.Role.FeatureIdRole = QgsAttributeTableModel.CustomRole.FeatureId
QgsAttributeTableModel.FeatureIdRole.is_monkey_patched = True
QgsAttributeTableModel.FeatureIdRole.__doc__ = "Get the feature id of the feature in this row"
QgsAttributeTableModel.FieldIndexRole = QgsAttributeTableModel.CustomRole.FieldIndex
QgsAttributeTableModel.Role.FieldIndexRole = QgsAttributeTableModel.CustomRole.FieldIndex
QgsAttributeTableModel.FieldIndexRole.is_monkey_patched = True
QgsAttributeTableModel.FieldIndexRole.__doc__ = "Get the field index of this column"
QgsAttributeTableModel.UserRole = QgsAttributeTableModel.CustomRole.User
QgsAttributeTableModel.Role.UserRole = QgsAttributeTableModel.CustomRole.User
QgsAttributeTableModel.UserRole.is_monkey_patched = True
QgsAttributeTableModel.UserRole.__doc__ = "Start further roles starting from this role"
QgsAttributeTableModel.SortRole = QgsAttributeTableModel.CustomRole.Sort
QgsAttributeTableModel.Role.SortRole = QgsAttributeTableModel.CustomRole.Sort
QgsAttributeTableModel.SortRole.is_monkey_patched = True
QgsAttributeTableModel.SortRole.__doc__ = "Role used for sorting start here"
QgsAttributeTableModel.CustomRole.__doc__ = """Custom model roles.
.. note::
Prior to QGIS 3.36 this was available as QgsAttributeTableModel.Role
.. versionadded:: 3.36
* ``FeatureId``: Get the feature id of the feature in this row
Available as ``QgsAttributeTableModel.FeatureIdRole`` in older QGIS releases.
* ``FieldIndex``: Get the field index of this column
Available as ``QgsAttributeTableModel.FieldIndexRole`` in older QGIS releases.
* ``User``: Start further roles starting from this role
Available as ``QgsAttributeTableModel.UserRole`` in older QGIS releases.
* ``Sort``: Role used for sorting start here
Available as ``QgsAttributeTableModel.SortRole`` in older QGIS releases.
"""
# --
QgsAttributeTableModel.CustomRole.baseClass = QgsAttributeTableModel
try:
QgsAttributeTableModel.__attribute_docs__ = {'modelChanged': 'Model has been changed\n'}
except NameError:
pass
try:
QgsAttributeTableModel.__group__ = ['attributetable']
except NameError:
pass