Skip to content

Commit 14cefe3

Browse files
committedMay 17, 2018
QgsFeatureListModel inherits QSortFilterProxyModel
1 parent 2544391 commit 14cefe3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
 

‎python/gui/auto_generated/attributetable/qgsfeaturelistmodel.sip.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212

13-
class QgsFeatureListModel : QAbstractProxyModel, QgsFeatureModel
13+
class QgsFeatureListModel : QSortFilterProxyModel, QgsFeatureModel
1414
{
1515

1616
%TypeHeaderCode

‎src/gui/attributetable/qgsfeaturelistmodel.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
#include <QSettings>
2424

2525
QgsFeatureListModel::QgsFeatureListModel( QgsAttributeTableFilterModel *sourceModel, QObject *parent )
26-
: QAbstractProxyModel( parent )
27-
, mInjectNull( false )
26+
: QSortFilterProxyModel( parent )
2827
{
2928
setSourceModel( sourceModel );
3029
}

‎src/gui/attributetable/qgsfeaturelistmodel.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "qgsexpression.h"
1919
#include "qgis.h"
2020

21-
#include <QAbstractProxyModel>
21+
#include <QSortFilterProxyModel>
2222
#include <QVariant>
2323
#include <QItemSelectionModel>
2424

@@ -36,7 +36,7 @@ class QgsVectorLayerCache;
3636
* \ingroup gui
3737
* \class QgsFeatureListModel
3838
*/
39-
class GUI_EXPORT QgsFeatureListModel : public QAbstractProxyModel, public QgsFeatureModel
39+
class GUI_EXPORT QgsFeatureListModel : public QSortFilterProxyModel, public QgsFeatureModel
4040
{
4141
Q_OBJECT
4242

@@ -132,9 +132,10 @@ class GUI_EXPORT QgsFeatureListModel : public QAbstractProxyModel, public QgsFea
132132
mutable QgsExpression mDisplayExpression;
133133
QgsAttributeTableFilterModel *mFilterModel = nullptr;
134134
QString mParserErrorString;
135-
bool mInjectNull;
135+
bool mInjectNull = false;
136136
mutable QgsExpressionContext mExpressionContext;
137137
mutable QMap< QgsFeatureId, QList<QgsConditionalStyle> > mRowStylesMap;
138+
bool mSortByDisplayExpression = false;
138139
};
139140

140141
Q_DECLARE_METATYPE( QgsFeatureListModel::FeatureInfo )

0 commit comments

Comments
 (0)
Please sign in to comment.