Class: QgsLayerTreeProxyModel

class qgis.gui.QgsLayerTreeProxyModel(treeModel: QgsLayerTreeModel, parent: QObject)

Bases: PyQt5.QtCore.QSortFilterProxyModel

Constructs QgsLayerTreeProxyModel with source model treeModel and a parent

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

New in version 3.18.

Parameters
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)