Class: QgsFieldProxyModel

class qgis.core.QgsFieldProxyModel(parent: QObject = None)

Bases: PyQt5.QtCore.QSortFilterProxyModel

QgsFieldProxModel creates a proxy model with a QgsFieldModel as source model. It can be used to filter the fields based on their types.

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

New in version 2.3.

Parameters

parent

AllTypes = 63
Date = 16
DateTime = 128
Double = 8
class Filter

Bases: int

class Filters

Bases: sip.wrapper

QgsFieldProxyModel.Filters(Union[QgsFieldProxyModel.Filters, QgsFieldProxyModel.Filter]) QgsFieldProxyModel.Filters(QgsFieldProxyModel.Filters)

baseClass

alias of QgsFieldProxyModel

HideReadOnly = 64
Int = 2
LongLong = 4
Numeric = 14
String = 1
Time = 32
beginInsertColumns()
beginInsertRows()
beginMoveColumns()
beginMoveRows()
beginRemoveColumns()
beginRemoveRows()
beginResetModel()
changePersistentIndex()
changePersistentIndexList()
childEvent()
connectNotify()
createIndex()
customEvent()
decodeData()
disconnectNotify()
encodeData()
endInsertColumns()
endInsertRows()
endMoveColumns()
endMoveRows()
endRemoveColumns()
endRemoveRows()
endResetModel()
filterAcceptsColumn()
filterAcceptsRow(self, source_row: int, source_parent: QModelIndex) → bool
Parameters
  • source_row (int) –

  • source_parent (QModelIndex) –

Return type

bool

filters(self) → QgsFieldProxyModel.Filters

Returns the filters controlling displayed fields.

See also

setFilters()

Return type

QgsFieldProxyModel.Filters

invalidateFilter()
isSignalConnected()
lessThan(self, left: QModelIndex, right: QModelIndex) → bool
Parameters
  • left (QModelIndex) –

  • right (QModelIndex) –

Return type

bool

persistentIndexList()
receivers()
resetInternalData()
sender()
senderSignalIndex()
setFilters(self, filters: Union[QgsFieldProxyModel.Filters, QgsFieldProxyModel.Filter]) → QgsFieldProxyModel

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

Parameters

filters (Union[QgsFieldProxyModel.Filters) – are Filter flags

See also

filters()

Return type

QgsFieldProxyModel

sourceFieldModel(self) → QgsFieldModel

Returns the QgsFieldModel used in this QSortFilterProxyModel

Return type

QgsFieldModel

timerEvent()