Skip to content
Permalink
Browse files

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
  • Loading branch information
m-kuhn committed Jul 14, 2017
1 parent b5dc9fd commit bf94df83f1cea147083528473957be8cd917f5e0
Showing with 0 additions and 4 deletions.
  1. +0 −4 src/gui/attributetable/qgsfeaturelistmodel.cpp
@@ -75,10 +75,6 @@ QVariant QgsFeatureListModel::data( const QModelIndex &index, int role ) const
{
return QgsApplication::nullRepresentation();
}
else if ( role == QgsAttributeTableModel::FeatureIdRole )
{
return QVariant( QVariant::Int );
}
else
{
return QVariant( QVariant::Invalid );

0 comments on commit bf94df8

Please sign in to comment.
You can’t perform that action at this time.