Skip to content

Commit bf94df8

Browse files
committed
Return invalid fid instead of null fid
The default comparison code for two QVariants does a really crappy job when it comes to NULL values. I.e. it will return true for `QVariant( 0 ) == QVariant( QVariant::Int )` We work around this issue here by returning an invalid QVariant instead, which - and luckily also Qt is aware of this - also is different from 0. Fix #16745
1 parent b5dc9fd commit bf94df8

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/gui/attributetable/qgsfeaturelistmodel.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ QVariant QgsFeatureListModel::data( const QModelIndex &index, int role ) const
7575
{
7676
return QgsApplication::nullRepresentation();
7777
}
78-
else if ( role == QgsAttributeTableModel::FeatureIdRole )
79-
{
80-
return QVariant( QVariant::Int );
81-
}
8278
else
8379
{
8480
return QVariant( QVariant::Invalid );

0 commit comments

Comments
 (0)