From f939f8f5543a5b6f24c2d5e9e848ae91c825e3cc Mon Sep 17 00:00:00 2001 From: lanckmann Date: Tue, 19 Aug 2025 12:28:36 -0400 Subject: [PATCH] Fix build errors and update Python bindings --- .../attributetable/qgsattributetableview.sip.in | 7 +++++++ python/gui/auto_additions/qgsattributetableview.py | 4 ++-- .../attributetable/qgsattributetableview.sip.in | 7 +++++++ src/gui/attributetable/qgsattributetableview.cpp | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/python/PyQt6/gui/auto_generated/attributetable/qgsattributetableview.sip.in b/python/PyQt6/gui/auto_generated/attributetable/qgsattributetableview.sip.in index 2b2b0a306b2..b00c56779a9 100644 --- a/python/PyQt6/gui/auto_generated/attributetable/qgsattributetableview.sip.in +++ b/python/PyQt6/gui/auto_generated/attributetable/qgsattributetableview.sip.in @@ -172,6 +172,13 @@ Emitted when a column in the view has been resized. No longer used. %End + /** + * Emitted when a row header is double-clicked to request zooming to the feature. + * \param fid the feature ID of the double-clicked row + * \since QGIS 3.46 + */ + void zoomToFeatureRequested( QgsFeatureId fid ); + public slots: void repaintRequested( const QModelIndexList &indexes ); void repaintRequested(); diff --git a/python/gui/auto_additions/qgsattributetableview.py b/python/gui/auto_additions/qgsattributetableview.py index de6124d161a..700a6b4d170 100644 --- a/python/gui/auto_additions/qgsattributetableview.py +++ b/python/gui/auto_additions/qgsattributetableview.py @@ -1,9 +1,9 @@ # The following has been generated automatically from src/gui/attributetable/qgsattributetableview.h try: - QgsAttributeTableView.__attribute_docs__ = {'willShowContextMenu': 'Emitted in order to provide a hook to add additional* menu entries to\nthe context menu.\n\n:param menu: If additional QMenuItems are added, they will show up in\n the context menu.\n:param atIndex: The QModelIndex, to which the context menu belongs.\n Relative to the source model. In most cases, this will\n be a :py:class:`QgsAttributeTableFilterModel`\n', 'columnResized': 'Emitted when a column in the view has been resized.\n\n:param column: column index (starts at 0)\n:param width: new width in pixel\n', 'finished': '.. deprecated:: 3.40\n\n No longer used.\n'} + QgsAttributeTableView.__attribute_docs__ = {'willShowContextMenu': 'Emitted in order to provide a hook to add additional* menu entries to\nthe context menu.\n\n:param menu: If additional QMenuItems are added, they will show up in\n the context menu.\n:param atIndex: The QModelIndex, to which the context menu belongs.\n Relative to the source model. In most cases, this will\n be a :py:class:`QgsAttributeTableFilterModel`\n', 'columnResized': 'Emitted when a column in the view has been resized.\n\n:param column: column index (starts at 0)\n:param width: new width in pixel\n', 'finished': '.. deprecated:: 3.40\n\n No longer used.\n', 'zoomToFeatureRequested': 'Emitted when a row header is double-clicked to request zooming to the\nfeature.\n\n:param fid: the feature ID of the double-clicked row\n\n.. versionadded:: 3.46\n'} QgsAttributeTableView.__virtual_methods__ = ['setModel', 'selectRow', '_q_selectRow'] QgsAttributeTableView.__overridden_methods__ = ['eventFilter', 'mousePressEvent', 'mouseReleaseEvent', 'mouseMoveEvent', 'keyPressEvent', 'contextMenuEvent', 'closeEvent', 'selectAll'] - QgsAttributeTableView.__signal_arguments__ = {'willShowContextMenu': ['menu: QMenu', 'atIndex: QModelIndex'], 'columnResized': ['column: int', 'width: int']} + QgsAttributeTableView.__signal_arguments__ = {'willShowContextMenu': ['menu: QMenu', 'atIndex: QModelIndex'], 'columnResized': ['column: int', 'width: int'], 'zoomToFeatureRequested': ['fid: QgsFeatureId']} QgsAttributeTableView.__group__ = ['attributetable'] except (NameError, AttributeError): pass diff --git a/python/gui/auto_generated/attributetable/qgsattributetableview.sip.in b/python/gui/auto_generated/attributetable/qgsattributetableview.sip.in index 2b2b0a306b2..b00c56779a9 100644 --- a/python/gui/auto_generated/attributetable/qgsattributetableview.sip.in +++ b/python/gui/auto_generated/attributetable/qgsattributetableview.sip.in @@ -172,6 +172,13 @@ Emitted when a column in the view has been resized. No longer used. %End + /** + * Emitted when a row header is double-clicked to request zooming to the feature. + * \param fid the feature ID of the double-clicked row + * \since QGIS 3.46 + */ + void zoomToFeatureRequested( QgsFeatureId fid ); + public slots: void repaintRequested( const QModelIndexList &indexes ); void repaintRequested(); diff --git a/src/gui/attributetable/qgsattributetableview.cpp b/src/gui/attributetable/qgsattributetableview.cpp index 8a408fb655a..9d1c148a66b 100644 --- a/src/gui/attributetable/qgsattributetableview.cpp +++ b/src/gui/attributetable/qgsattributetableview.cpp @@ -92,7 +92,7 @@ bool QgsAttributeTableView::eventFilter( QObject *object, QEvent *event ) const QModelIndex index = mFilterModel->index( row, 0 ); if ( index.isValid() ) { - const QgsFeatureId fid = mFilterModel->rowToId( index.row() ); + const QgsFeatureId fid = mFilterModel->rowToId( index ); emit zoomToFeatureRequested( fid ); } }