From 4116f95d6b474f274a1c13597ad687961a7cab4f Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Sun, 12 Jun 2016 18:05:32 +0200 Subject: [PATCH] Fix the preview column in form view when first column is action widget --- src/gui/attributetable/qgsattributetablefiltermodel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/attributetable/qgsattributetablefiltermodel.cpp b/src/gui/attributetable/qgsattributetablefiltermodel.cpp index 214c10ec797..5f872a53f35 100644 --- a/src/gui/attributetable/qgsattributetablefiltermodel.cpp +++ b/src/gui/attributetable/qgsattributetablefiltermodel.cpp @@ -482,9 +482,10 @@ QModelIndex QgsAttributeTableFilterModel::mapToSource( const QModelIndex& proxyI int sourceColumn = mapColumnToSource( proxyIndex.column() ); - // For the action column there is no matching column in the source model: invalid + // For the action column there is no matching column in the source model, just return the first one + // so we are still able to query for the feature id, the feature... if ( sourceColumn == -1 ) - return QModelIndex(); + sourceColumn = 0; return QSortFilterProxyModel::mapToSource( index( proxyIndex.row(), sourceColumn, proxyIndex.parent() ) ); }