Skip to content

Commit

Permalink
QgsFeatureListModel inherits QSortFilterProxyModel
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 17, 2018
1 parent 2544391 commit 14cefe3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -10,7 +10,7 @@






class QgsFeatureListModel : QAbstractProxyModel, QgsFeatureModel class QgsFeatureListModel : QSortFilterProxyModel, QgsFeatureModel
{ {


%TypeHeaderCode %TypeHeaderCode
Expand Down
3 changes: 1 addition & 2 deletions src/gui/attributetable/qgsfeaturelistmodel.cpp
Expand Up @@ -23,8 +23,7 @@
#include <QSettings> #include <QSettings>


QgsFeatureListModel::QgsFeatureListModel( QgsAttributeTableFilterModel *sourceModel, QObject *parent ) QgsFeatureListModel::QgsFeatureListModel( QgsAttributeTableFilterModel *sourceModel, QObject *parent )
: QAbstractProxyModel( parent ) : QSortFilterProxyModel( parent )
, mInjectNull( false )
{ {
setSourceModel( sourceModel ); setSourceModel( sourceModel );
} }
Expand Down
7 changes: 4 additions & 3 deletions src/gui/attributetable/qgsfeaturelistmodel.h
Expand Up @@ -18,7 +18,7 @@
#include "qgsexpression.h" #include "qgsexpression.h"
#include "qgis.h" #include "qgis.h"


#include <QAbstractProxyModel> #include <QSortFilterProxyModel>
#include <QVariant> #include <QVariant>
#include <QItemSelectionModel> #include <QItemSelectionModel>


Expand All @@ -36,7 +36,7 @@ class QgsVectorLayerCache;
* \ingroup gui * \ingroup gui
* \class QgsFeatureListModel * \class QgsFeatureListModel
*/ */
class GUI_EXPORT QgsFeatureListModel : public QAbstractProxyModel, public QgsFeatureModel class GUI_EXPORT QgsFeatureListModel : public QSortFilterProxyModel, public QgsFeatureModel
{ {
Q_OBJECT Q_OBJECT


Expand Down Expand Up @@ -132,9 +132,10 @@ class GUI_EXPORT QgsFeatureListModel : public QAbstractProxyModel, public QgsFea
mutable QgsExpression mDisplayExpression; mutable QgsExpression mDisplayExpression;
QgsAttributeTableFilterModel *mFilterModel = nullptr; QgsAttributeTableFilterModel *mFilterModel = nullptr;
QString mParserErrorString; QString mParserErrorString;
bool mInjectNull; bool mInjectNull = false;
mutable QgsExpressionContext mExpressionContext; mutable QgsExpressionContext mExpressionContext;
mutable QMap< QgsFeatureId, QList<QgsConditionalStyle> > mRowStylesMap; mutable QMap< QgsFeatureId, QList<QgsConditionalStyle> > mRowStylesMap;
bool mSortByDisplayExpression = false;
}; };


Q_DECLARE_METATYPE( QgsFeatureListModel::FeatureInfo ) Q_DECLARE_METATYPE( QgsFeatureListModel::FeatureInfo )
Expand Down

0 comments on commit 14cefe3

Please sign in to comment.