Class: QgsBrowserGuiModel

class qgis.gui.QgsBrowserGuiModel

Bases: QgsBrowserModel

A model for showing available data sources and other items in a structured tree.

QgsBrowserGuiModel is the foundation for the QGIS browser panel, and includes items for the different data providers and folders accessible to users.

New in version 3.10.

QgsBrowserGuiModel(parent: QObject = None) Constructor for QgsBrowserGuiModel, with the specified parent object.

Note

QgsBrowserModel models are not initially populated and use a deferred initialization approach. After constructing a QgsBrowserModel, a call must be made to initialize() in order to populate the model.

Methods

addRootItems

Populates the model

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

changePersistentIndex

changePersistentIndexList

childEvent

connectNotify

createIndex

customEvent

decodeData

disconnectNotify

dropMimeData

param data

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

flags

param index

isSignalConnected

persistentIndexList

receivers

removeRootItems

resetInternalData

sender

senderSignalIndex

setData

param index

setMessageBar

Sets message bar that will be passed in QgsDataItemGuiContext to data items

timerEvent

addRootItems(self)

Populates the model

QgsBrowserGuiModel.beginInsertColumns(self, QModelIndex, int, int)
QgsBrowserGuiModel.beginInsertRows(self, QModelIndex, int, int)
QgsBrowserGuiModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsBrowserGuiModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsBrowserGuiModel.beginRemoveColumns(self, QModelIndex, int, int)
QgsBrowserGuiModel.beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
QgsBrowserGuiModel.changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
QgsBrowserGuiModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
customEvent(self, QEvent)
QgsBrowserGuiModel.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
disconnectNotify(self, QMetaMethod)
dropMimeData(self, data: QMimeData, action: Qt.DropAction, row: int, column: int, parent: QModelIndex)bool
Parameters
  • data (QMimeData) –

  • action (Qt.DropAction) –

  • row (int) –

  • column (int) –

  • parent (QModelIndex) –

Return type

bool

encodeData(self, Iterable[QModelIndex], QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
flags(self, index: QModelIndex)Qt.ItemFlags
Parameters

index (QModelIndex) –

Return type

Qt.ItemFlags

isSignalConnected(self, QMetaMethod)bool
persistentIndexList(self)List[QModelIndex]
receivers(self, PYQT_SIGNAL)int
removeRootItems(self)
resetInternalData(self)
sender(self)QObject
senderSignalIndex(self)int
setData(self, index: QModelIndex, value: Any, role: int = Qt.EditRole)bool
Parameters
  • index (QModelIndex) –

  • value (Any) –

  • role (int = Qt.EditRole) –

Return type

bool

setMessageBar(self, bar: QgsMessageBar)

Sets message bar that will be passed in QgsDataItemGuiContext to data items

Parameters

bar (QgsMessageBar) –

timerEvent(self, QTimerEvent)