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.

Methods

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

param source_row

filters

Returns the filters controlling displayed fields.

invalidateFilter

isSignalConnected

lessThan

param left

persistentIndexList

receivers

resetInternalData

sender

senderSignalIndex

setFilters

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

sourceFieldModel

Returns the QgsFieldModel used in this QSortFilterProxyModel

timerEvent

Attributes

AllTypes

Date

DateTime

Double

HideReadOnly

Int

LongLong

Numeric

String

Time

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 qgis._core.QgsFieldProxyModel

HideReadOnly = 64
Int = 2
LongLong = 4
Numeric = 14
String = 1
Time = 32
QgsFieldProxyModel.beginInsertColumns(self, QModelIndex, int, int)
QgsFieldProxyModel.beginInsertRows(self, QModelIndex, int, int)
QgsFieldProxyModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsFieldProxyModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsFieldProxyModel.beginRemoveColumns(self, QModelIndex, int, int)
QgsFieldProxyModel.beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
QgsFieldProxyModel.changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
QgsFieldProxyModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
customEvent(self, QEvent)
QgsFieldProxyModel.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
disconnectNotify(self, QMetaMethod)
encodeData(self, Iterable[QModelIndex], QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
filterAcceptsColumn(self, int, QModelIndex)bool
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(self)
isSignalConnected(self, QMetaMethod)bool
lessThan(self, left: QModelIndex, right: QModelIndex)bool
Parameters
  • left (QModelIndex) –

  • right (QModelIndex) –

Return type

bool

persistentIndexList(self)List[QModelIndex]
receivers(self, PYQT_SIGNAL)int
resetInternalData(self)
sender(self)QObject
senderSignalIndex(self)int
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(self, QTimerEvent)