QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Slots | Signals | Public Member Functions | List of all members
QgsQueryResultModel Class Reference

The QgsQueryResultModel class is a model for QgsAbstractDatabaseProviderConnection::QueryResult. More...

#include <qgsqueryresultmodel.h>

Inheritance diagram for QgsQueryResultModel:
Inheritance graph
[legend]

Public Slots

void cancel ()
 Cancels the row fetching. More...
 
void rowsReady (const QList< QList< QVariant > > &rows)
 Triggered when newRows have been fetched and can be added to the model. More...
 

Signals

void 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). More...
 
void fetchingStarted ()
 Emitted when fetching of rows has started. More...
 
void fetchMoreRows (qlonglong maxRows)
 Emitted when more rows are requested. More...
 

Public Member Functions

 QgsQueryResultModel (const QgsAbstractDatabaseProviderConnection::QueryResult &queryResult, QObject *parent=nullptr)
 Constructs a QgsQueryResultModel from a queryResult with optional parent. More...
 
 ~QgsQueryResultModel ()
 
bool canFetchMore (const QModelIndex &parent) const override
 
int columnCount (const QModelIndex &parent) const override
 
QStringList columns () const
 Returns the column names. More...
 
QVariant data (const QModelIndex &index, int role) const override
 
void fetchMore (const QModelIndex &parent) override
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
QgsAbstractDatabaseProviderConnection::QueryResult queryResult () const
 Returns the query result. More...
 
int rowCount (const QModelIndex &parent) const override
 

Detailed Description

The QgsQueryResultModel class is a model for QgsAbstractDatabaseProviderConnection::QueryResult.

Since
QGIS 3.18

Definition at line 80 of file qgsqueryresultmodel.h.

Constructor & Destructor Documentation

◆ QgsQueryResultModel()

QgsQueryResultModel::QgsQueryResultModel ( const QgsAbstractDatabaseProviderConnection::QueryResult queryResult,
QObject *  parent = nullptr 
)

Constructs a QgsQueryResultModel from a queryResult with optional parent.

Definition at line 21 of file qgsqueryresultmodel.cpp.

◆ ~QgsQueryResultModel()

QgsQueryResultModel::~QgsQueryResultModel ( )

Definition at line 83 of file qgsqueryresultmodel.cpp.

Member Function Documentation

◆ cancel

void QgsQueryResultModel::cancel ( )
slot

Cancels the row fetching.

Definition at line 65 of file qgsqueryresultmodel.cpp.

◆ canFetchMore()

bool QgsQueryResultModel::canFetchMore ( const QModelIndex &  parent) const
override

Definition at line 48 of file qgsqueryresultmodel.cpp.

◆ columnCount()

int QgsQueryResultModel::columnCount ( const QModelIndex &  parent) const
override

Definition at line 104 of file qgsqueryresultmodel.cpp.

◆ columns()

QStringList QgsQueryResultModel::columns ( ) const

Returns the column names.

Definition at line 78 of file qgsqueryresultmodel.cpp.

◆ data()

QVariant QgsQueryResultModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 111 of file qgsqueryresultmodel.cpp.

◆ fetchingComplete

void QgsQueryResultModel::fetchingComplete ( )
signal

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

◆ fetchingStarted

void QgsQueryResultModel::fetchingStarted ( )
signal

Emitted when fetching of rows has started.

◆ fetchMore()

void QgsQueryResultModel::fetchMore ( const QModelIndex &  parent)
override

Definition at line 56 of file qgsqueryresultmodel.cpp.

◆ fetchMoreRows

void QgsQueryResultModel::fetchMoreRows ( qlonglong  maxRows)
signal

Emitted when more rows are requested.

Parameters
maxRowsthe number of rows that will be fetched.

◆ headerData()

QVariant QgsQueryResultModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
override

Definition at line 143 of file qgsqueryresultmodel.cpp.

◆ queryResult()

QgsAbstractDatabaseProviderConnection::QueryResult QgsQueryResultModel::queryResult ( ) const

Returns the query result.

Since
QGIS 3.22

Definition at line 73 of file qgsqueryresultmodel.cpp.

◆ rowCount()

int QgsQueryResultModel::rowCount ( const QModelIndex &  parent) const
override

Definition at line 97 of file qgsqueryresultmodel.cpp.

◆ rowsReady

void QgsQueryResultModel::rowsReady ( const QList< QList< QVariant > > &  rows)
slot

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

Definition at line 40 of file qgsqueryresultmodel.cpp.


The documentation for this class was generated from the following files: