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 529bf3f commit 6d2bab68ff40f0f2ef4c630ea92c591e644ba5df
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 QSettings().value( "qgis/nullValue", "NULL" ).toString();
}
else if ( role == QgsAttributeTableModel::FeatureIdRole )
{
return QVariant( QVariant::Int );
}
else
{
return QVariant( QVariant::Invalid );

0 comments on commit 6d2bab6

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