Class: QgsQueryResultModel

class qgis.core.QgsQueryResultModel

Bases: PyQt5.QtCore.QAbstractTableModel

The QgsQueryResultModel class is a model for QgsAbstractDatabaseProviderConnection.QueryResult

Added in version 3.18.

QgsQueryResultModel(queryResult: QgsAbstractDatabaseProviderConnection.QueryResult, parent: Optional[QObject] = None) Constructs a QgsQueryResultModel from a queryResult with optional parent

Methods

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

canFetchMore

param parent:

cancel

Cancels the row fetching.

changePersistentIndex

changePersistentIndexList

childEvent

columnCount

param parent:

columns

Returns the column names

connectNotify

createIndex

customEvent

data

param index:

decodeData

disconnectNotify

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

fetchMore

param parent:

headerData

param section:

isSignalConnected

persistentIndexList

queryResult

Returns the query result

receivers

resetInternalData

rowCount

param parent:

rowsReady

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

sender

senderSignalIndex

timerEvent

Signals

fetchMoreRows

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

fetchingComplete

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

fetchingStarted

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

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)
canFetchMore(self, parent: QModelIndex) bool
Parameters:

parent (QModelIndex)

Return type:

bool

cancel(self)

Cancels the row 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

columns(self) List[str]

Returns the column names

Return type:

List[str]

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)
fetchMore(self, parent: QModelIndex)
Parameters:

parent (QModelIndex)

fetchMoreRows

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

fetchingComplete

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

fetchingStarted

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

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]
queryResult(self) QgsAbstractDatabaseProviderConnection.QueryResult

Returns the query result

Added in version 3.22.

Return type:

QgsAbstractDatabaseProviderConnection.QueryResult

receivers(self, signal: PYQT_SIGNAL) int
resetInternalData(self)
rowCount(self, parent: QModelIndex) int
Parameters:

parent (QModelIndex)

Return type:

int

rowsReady(self, rows: Any)

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

Parameters:

rows (Any)

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