QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsFieldProxyModel Class Reference

A proxy model to filter the list of fields of a layer. More...

#include <qgsfieldproxymodel.h>

Inheritance diagram for QgsFieldProxyModel:

Public Types

enum  Filter {
  String = 1 << 0 , Int = 1 << 1 , LongLong = 1 << 2 , Double = 1 << 3 ,
  Numeric = Int | LongLong | Double , Date = 1 << 4 , Time = 1 << 5 , HideReadOnly = 1 << 6 ,
  DateTime = 1 << 7 , Binary = 1 << 8 , Boolean = 1 << 9 , OriginProvider = 1 << 10 ,
  AllTypes = Numeric | Date | String | Time | DateTime | Binary | Boolean
}
 Field type filters. More...
typedef QFlags< FilterFilters

Public Member Functions

 QgsFieldProxyModel (QObject *parent=nullptr)
 QgsFieldProxModel creates a proxy model with a QgsFieldModel as source model.
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override
const Filtersfilters () const
 Returns the filters controlling displayed fields.
bool lessThan (const QModelIndex &left, const QModelIndex &right) const override
QgsFieldProxyModelsetFilters (QgsFieldProxyModel::Filters filters)
 Set flags that affect how fields are filtered in the model.
QgsFieldModelsourceFieldModel ()
 Returns the QgsFieldModel used in this QSortFilterProxyModel.

Detailed Description

A proxy model to filter the list of fields of a layer.

Definition at line 30 of file qgsfieldproxymodel.h.

Member Typedef Documentation

◆ Filters

Definition at line 53 of file qgsfieldproxymodel.h.

Member Enumeration Documentation

◆ Filter

Field type filters.

Enumerator
String 

String fields.

Int 

Integer fields.

LongLong 

Longlong fields.

Double 

Double fields.

Numeric 

All numeric fields.

Date 

Date or datetime fields.

Time 

Time fields.

HideReadOnly 

Hide read-only fields.

DateTime 

Datetime fields.

Binary 

Binary fields, since QGIS 3.34.

Boolean 

Boolean fields, since QGIS 3.34.

OriginProvider 

Fields with a provider origin, since QGIS 3.38.

AllTypes 

All field types.

Definition at line 37 of file qgsfieldproxymodel.h.

Constructor & Destructor Documentation

◆ QgsFieldProxyModel()

QgsFieldProxyModel::QgsFieldProxyModel ( QObject * parent = nullptr)
explicit

QgsFieldProxModel creates a proxy model with a QgsFieldModel as source model.

It can be used to filter the fields based on their types.

Definition at line 23 of file qgsfieldproxymodel.cpp.

Member Function Documentation

◆ filterAcceptsRow()

bool QgsFieldProxyModel::filterAcceptsRow ( int source_row,
const QModelIndex & source_parent ) const
override

Definition at line 84 of file qgsfieldproxymodel.cpp.

◆ filters()

const Filters & QgsFieldProxyModel::filters ( ) const
inline

Returns the filters controlling displayed fields.

See also
setFilters()

Definition at line 76 of file qgsfieldproxymodel.h.

◆ lessThan()

bool QgsFieldProxyModel::lessThan ( const QModelIndex & left,
const QModelIndex & right ) const
override

Definition at line 136 of file qgsfieldproxymodel.cpp.

◆ setFilters()

QgsFieldProxyModel * QgsFieldProxyModel::setFilters ( QgsFieldProxyModel::Filters filters)

Set flags that affect how fields are filtered in the model.

Parameters
filtersare Filter flags
See also
filters()

Definition at line 31 of file qgsfieldproxymodel.cpp.

◆ sourceFieldModel()

QgsFieldModel * QgsFieldProxyModel::sourceFieldModel ( )
inline

Returns the QgsFieldModel used in this QSortFilterProxyModel.

Definition at line 63 of file qgsfieldproxymodel.h.


The documentation for this class was generated from the following files: