Class: QgsQueryResultModel

A model for QgsAbstractDatabaseProviderConnection.QueryResult.

Added in version 3.18.

Class Hierarchy

Inheritance diagram of qgis.core.QgsQueryResultModel

Base classes

QAbstractTableModel

QAbstractItemModel

QObject

Methods

cancel

Cancels the row fetching.

columns

Returns the column names

queryResult

Returns the query result

rowsReady

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

Signals

fetchMoreRows

Emitted when more rows are requested.

fetchingComplete

Emitted when rows have been fetched (all of them or a batch if maxRows was passed to fetchMoreRows() ) or when the fetching has been stopped (canceled).

fetchingStarted

Emitted when fetching of rows has started

class qgis.core.QgsQueryResultModel[source]

Bases: QAbstractTableModel

__init__(queryResult: QgsAbstractDatabaseProviderConnection.QueryResult, parent: QObject | None = None)

Constructs a QgsQueryResultModel from a queryResult with optional parent

Parameters:
cancel(self)[source]

Cancels the row fetching.

columns(self) List[str][source]

Returns the column names

Return type:

List[str]

signal fetchMoreRows(maxRows: int)[source]

Emitted when more rows are requested.

Parameters:

maxRows (int) – the number of rows that will be fetched.

signal fetchingComplete[source]

Emitted when rows have been fetched (all of them or a batch if maxRows was passed to fetchMoreRows() ) or when the fetching has been stopped (canceled).

See also

fetchMoreRows()

signal fetchingStarted[source]

Emitted when fetching of rows has started

queryResult(self) QgsAbstractDatabaseProviderConnection.QueryResult[source]

Returns the query result

Added in version 3.22.

Return type:

QgsAbstractDatabaseProviderConnection.QueryResult

rowsReady(self, rows: Any)[source]

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

Parameters:

rows (Any)