Skip to content

Commit 5ae7802

Browse files
committed
Fix attribute table cannot map index when filtered
1 parent 77fa125 commit 5ae7802

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/gui/attributetable/qgsattributetablefiltermodel.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,11 @@ QModelIndex QgsAttributeTableFilterModel::mapFromSource( const QModelIndex& sour
503503
if ( proxyIndex.column() < 0 )
504504
return QModelIndex();
505505

506-
return index( proxyIndex.row(), mapColumnToSource( proxyIndex.column() ), proxyIndex.parent() );
506+
int col = mapColumnToSource( proxyIndex.column() );
507+
if ( col == -1 )
508+
col = 0;
509+
510+
return index( proxyIndex.row(), col , proxyIndex.parent() );
507511
}
508512

509513
Qt::ItemFlags QgsAttributeTableFilterModel::flags( const QModelIndex& index ) const

0 commit comments

Comments
 (0)