QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Types | Public Member Functions | List of all members
QgsFieldProxyModel Class Reference

The QgsFieldProxyModel class provides an easy to use model to display the list of fields of a layer. More...

#include <qgsfieldproxymodel.h>

Inheritance diagram for QgsFieldProxyModel:
Inheritance graph
[legend]

Public Types

enum  Filter {
  String = 1, Int = 2, LongLong = 4, Double = 8,
  Numeric = Int | LongLong | Double, Date = 16, Time = 32, HideReadOnly = 64,
  AllTypes = Numeric | Date | String | Time
}
 Field type filters. More...
 

Public Member Functions

 QgsFieldProxyModel (QObject *parent=nullptr)
 QgsFieldProxModel creates a proxy model with a QgsFieldModel as source model. More...
 
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override
 
const Filters & filters () const
 Returns the filters controlling displayed fields. More...
 
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. More...
 
QgsFieldModelsourceFieldModel ()
 Returns the QgsFieldModel used in this QSortFilterProxyModel. More...
 

Detailed Description

The QgsFieldProxyModel class provides an easy to use model to display the list of fields of a layer.

Since
QGIS 2.3

Definition at line 32 of file qgsfieldproxymodel.h.

Member Enumeration Documentation

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.

AllTypes 

All field types.

Definition at line 39 of file qgsfieldproxymodel.h.

Constructor & Destructor Documentation

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 20 of file qgsfieldproxymodel.cpp.

Member Function Documentation

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

Definition at line 61 of file qgsfieldproxymodel.cpp.

const Filters& QgsFieldProxyModel::filters ( ) const
inline

Returns the filters controlling displayed fields.

See also
setFilters()

Definition at line 74 of file qgsfieldproxymodel.h.

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

Definition at line 94 of file qgsfieldproxymodel.cpp.

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 28 of file qgsfieldproxymodel.cpp.

QgsFieldModel* QgsFieldProxyModel::sourceFieldModel ( )
inline

Returns the QgsFieldModel used in this QSortFilterProxyModel.

Definition at line 61 of file qgsfieldproxymodel.h.


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