Class: QgsLayerTreeProxyModel

class qgis.gui.QgsLayerTreeProxyModel

Bases: PyQt5.QtCore.QSortFilterProxyModel

The QgsLayerTreeProxyModel class is a proxy model for QgsLayerTreeModel, supports private layers and text filtering.

New in version 3.18.

QgsLayerTreeProxyModel(treeModel: QgsLayerTreeModel, parent: QObject) Constructs QgsLayerTreeProxyModel with source model treeModel and a parent

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 sourceRow

invalidateFilter

isSignalConnected

lessThan

persistentIndexList

receivers

resetInternalData

sender

senderSignalIndex

setFilterText

Sets filter to filterText.

setShowPrivateLayers

Determines if private layers are shown.

showPrivateLayers

Returns if private layers are shown.

timerEvent

QgsLayerTreeProxyModel.beginInsertColumns(self, QModelIndex, int, int)
QgsLayerTreeProxyModel.beginInsertRows(self, QModelIndex, int, int)
QgsLayerTreeProxyModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsLayerTreeProxyModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsLayerTreeProxyModel.beginRemoveColumns(self, QModelIndex, int, int)
QgsLayerTreeProxyModel.beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
QgsLayerTreeProxyModel.changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
QgsLayerTreeProxyModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
customEvent(self, QEvent)
QgsLayerTreeProxyModel.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, sourceRow: int, sourceParent: QModelIndex)bool
Parameters
  • sourceRow (int) –

  • sourceParent (QModelIndex) –

Return type

bool

invalidateFilter(self)
isSignalConnected(self, QMetaMethod)bool
QgsLayerTreeProxyModel.lessThan(self, QModelIndex, QModelIndex) -> bool
persistentIndexList(self)List[QModelIndex]
receivers(self, PYQT_SIGNAL)int
resetInternalData(self)
sender(self)QObject
senderSignalIndex(self)int
setFilterText(self, filterText: str = '')

Sets filter to filterText.

Parameters

filterText (str = '') –

setShowPrivateLayers(self, showPrivate: bool)

Determines if private layers are shown.

Parameters

showPrivate (bool) –

showPrivateLayers(self)bool

Returns if private layers are shown.

Return type

bool

timerEvent(self, QTimerEvent)