Class: QgsLayerMetadataResultsModel

class qgis.gui.QgsLayerMetadataResultsModel

Bases: PyQt5.QtCore.QAbstractTableModel

The QgsLayerMetadataResultsModel class handles the metadata fetching from the registered layer metadata providers.

Added in version 3.28.

QgsLayerMetadataResultsModel(searchContext: QgsMetadataSearchContext, parent: Optional[QObject] = None) Constructs a QgsLayerMetadataResultsModel from a searchContext and an optional parent.

Enums

CustomRole

Bases: enum.IntEnum

Roles

alias of CustomRole

Methods

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

cancel

Cancels the results fetching.

changePersistentIndex

changePersistentIndexList

childEvent

columnCount

param parent:

connectNotify

createIndex

customEvent

data

param index:

decodeData

disconnectNotify

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

headerData

param section:

isSignalConnected

persistentIndexList

receivers

reload

Load/Reload model data synchronously.

reloadAsync

Load/Reload model data asynchronously using threads.

resetInternalData

resultsReady

Triggered when metadata results have been fetched and can be added to the model.

rowCount

param parent:

sender

senderSignalIndex

timerEvent

Signals

progressChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

Attributes

Abstract

DataProviderName

GeometryType

Identifier

Title

Abstract = 2
class CustomRole(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: enum.IntEnum

The Roles enum represents the user roles for the model.

Note

Prior to QGIS 3.36 this was available as QgsLayerMetadataResultsModel.Roles

Added in version 3.36.

  • Metadata: Layer metadata role

baseClass

alias of QgsLayerMetadataResultsModel

DataProviderName = 3
GeometryType = 4
Identifier = 0
Roles

alias of CustomRole

class Sections

Bases: int

Title = 1
beginInsertColumns(self, parent: QModelIndex, first: int, last: int)
beginInsertRows(self, parent: QModelIndex, first: int, last: int)
beginMoveColumns(self, sourceParent: QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: QModelIndex, destinationColumn: int) bool
beginMoveRows(self, sourceParent: QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: QModelIndex, destinationRow: int) bool
beginRemoveColumns(self, parent: QModelIndex, first: int, last: int)
beginRemoveRows(self, parent: QModelIndex, first: int, last: int)
beginResetModel(self)
cancel(self)

Cancels the results fetching.

changePersistentIndex(self, from_: QModelIndex, to: QModelIndex)
changePersistentIndexList(self, from_: Iterable[QModelIndex], to: Iterable[QModelIndex])
childEvent(self, a0: QChildEvent | None)
columnCount(self, parent: QModelIndex) int
Parameters:

parent (QModelIndex)

Return type:

int

connectNotify(self, signal: QMetaMethod)
createIndex(self, row: int, column: int, object: Any = None) QModelIndex
customEvent(self, a0: QEvent | None)
data(self, index: QModelIndex, role: int) Any
Parameters:
  • index (QModelIndex)

  • role (int)

Return type:

Any

decodeData(self, row: int, column: int, parent: QModelIndex, stream: QDataStream) bool
disconnectNotify(self, signal: QMetaMethod)
encodeData(self, indexes: Iterable[QModelIndex], stream: QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
headerData(self, section: int, orientation: Qt.Orientation, role: int) Any
Parameters:
  • section (int)

  • orientation (Qt.Orientation)

  • role (int)

Return type:

Any

isSignalConnected(self, signal: QMetaMethod) bool
persistentIndexList(self) List[QModelIndex]
progressChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...)

  • revision (int = ...)

  • arguments (Sequence = ...)

Return type:

PYQT_SIGNAL

receivers(self, signal: PYQT_SIGNAL) int
reload(self)

Load/Reload model data synchronously.

reloadAsync(self)

Load/Reload model data asynchronously using threads.

resetInternalData(self)
resultsReady(self, results: QgsLayerMetadataSearchResults)

Triggered when metadata results have been fetched and can be added to the model.

Parameters:

results (QgsLayerMetadataSearchResults)

rowCount(self, parent: QModelIndex) int
Parameters:

parent (QModelIndex)

Return type:

int

sender(self) QObject | None
senderSignalIndex(self) int
timerEvent(self, a0: QTimerEvent | None)