Skip to content
Permalink
Browse files

fix type error in value relation

  • Loading branch information
tomasMizera authored and wonder-sk committed Nov 2, 2020
1 parent ed709c1 commit d6247fd6ab007659cfc2c6eb48718e38d1f431e8
Showing with 4 additions and 4 deletions.
  1. +3 −3 src/quickgui/qgsquickfeatureslistmodel.cpp
  2. +1 −1 src/quickgui/qgsquickfeatureslistmodel.h
@@ -253,18 +253,18 @@ int QgsQuickFeaturesListModel::rowFromAttribute( const int role, const QVariant
return -1;
}

int QgsQuickFeaturesListModel::keyFromAttribute( const int role, const QVariant &value ) const
QVariant QgsQuickFeaturesListModel::keyFromAttribute( const int role, const QVariant &value ) const
{
for ( int i = 0; i < mFeatures.count(); ++i )
{
QVariant d = data( index( i, 0 ), role );
if ( d == value )
{
QVariant key = data( index( i, 0 ), KeyColumn );
return key.toInt();
return key;
}
}
return -1;
return QVariant();
}

QgsQuickFeatureLayerPair QgsQuickFeaturesListModel::featureLayerPair( const int &featureId )
@@ -112,7 +112,7 @@ class QUICK_EXPORT QgsQuickFeaturesListModel : public QAbstractListModel
* \return KeyColumn role for found feature, returns -1 if no feature is found. If more features
* match requested role and value, KeyColumn for first is returned.
*/
Q_INVOKABLE int keyFromAttribute( const int role, const QVariant &value ) const;
Q_INVOKABLE QVariant keyFromAttribute( const int role, const QVariant &value ) const;

//! Returns maximum amount of features that can be queried from layer
int featuresLimit() const;

0 comments on commit d6247fd

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