Skip to content
Permalink
Browse files

add missing currentFeature, removes android compilation warning

  • Loading branch information
PeterPetrik authored and nyalldawson committed Nov 19, 2020
1 parent eec1695 commit 8f4367dea62c6608025b6989965eda0949de1d8a
Showing with 12 additions and 2 deletions.
  1. +7 −0 src/quickgui/qgsquickfeatureslistmodel.cpp
  2. +5 −2 src/quickgui/qgsquickfeatureslistmodel.h
@@ -23,6 +23,8 @@ QgsQuickFeaturesListModel::QgsQuickFeaturesListModel( QObject *parent )
{
}

QgsQuickFeaturesListModel::~QgsQuickFeaturesListModel() = default;

int QgsQuickFeaturesListModel::rowCount( const QModelIndex &parent ) const
{
// For list models only the root node (an invalid parent) should return the list's size. For all
@@ -305,6 +307,11 @@ void QgsQuickFeaturesListModel::setCurrentFeature( QgsFeature feature )
emit currentFeatureChanged( mCurrentFeature );
}

QgsFeature QgsQuickFeaturesListModel::currentFeature() const
{
return mCurrentFeature;
}

int QgsQuickFeaturesListModel::featuresLimit() const
{
return FEATURES_LIMIT;
@@ -58,7 +58,7 @@ class QUICK_EXPORT QgsQuickFeaturesListModel : public QAbstractListModel
* Feature that has opened feature form.
* This property needs to be set before opening feature form to be able to evaulate filter expressions that contain form scope.
*/
Q_PROPERTY( QgsFeature currentFeature WRITE setCurrentFeature NOTIFY currentFeatureChanged )
Q_PROPERTY( QgsFeature currentFeature READ currentFeature WRITE setCurrentFeature NOTIFY currentFeatureChanged )

public:

@@ -76,7 +76,7 @@ class QUICK_EXPORT QgsQuickFeaturesListModel : public QAbstractListModel

//! Create features list model
explicit QgsQuickFeaturesListModel( QObject *parent = nullptr );
~QgsQuickFeaturesListModel() override {};
~QgsQuickFeaturesListModel() override;

//! Function to get QgsQuickFeatureLayerPair by feature id
Q_INVOKABLE QgsQuickFeatureLayerPair featureLayerPair( const int &featureId );
@@ -161,6 +161,9 @@ class QUICK_EXPORT QgsQuickFeaturesListModel : public QAbstractListModel
//! Sets current feature property
void setCurrentFeature( QgsFeature feature );

//! Gets current feature property
QgsFeature currentFeature() const;

signals:

/**

0 comments on commit 8f4367d

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