QGIS API Documentation 3.43.0-Master (ebb4087afc0)
Loading...
Searching...
No Matches
Classes | Signals | Public Member Functions | List of all members
QgsStoredQueryManager Class Reference

A manager for stored SQL queries. More...

#include <qgsstoredquerymanager.h>

Inheritance diagram for QgsStoredQueryManager:
Inheritance graph
[legend]

Classes

class  QueryDetails
 Contains details about a stored query. More...
 

Signals

void queryAdded (const QString &name, Qgis::QueryStorageBackend backend)
 Emitted when a query is added to the manager.
 
void queryChanged (const QString &name, Qgis::QueryStorageBackend backend)
 Emitted when an existing query is changed in the manager.
 
void queryRemoved (const QString &name, Qgis::QueryStorageBackend backend)
 Emitted when a query is removed from the manager.
 

Public Member Functions

 QgsStoredQueryManager (QObject *parent=nullptr)
 Constructor for QgsStoredQueryManager, with the specified parent object.
 
QList< QgsStoredQueryManager::QueryDetailsallQueries () const
 Returns details of all queries stored in the manager.
 
QStringList allQueryNames (Qgis::QueryStorageBackend backend=Qgis::QueryStorageBackend::LocalProfile) const
 Returns a list of the names of all stored queries for the specified backend.
 
QString query (const QString &name, Qgis::QueryStorageBackend backend=Qgis::QueryStorageBackend::LocalProfile) const
 Returns the query definition with matching name, from the specified backend.
 
void removeQuery (const QString &name, Qgis::QueryStorageBackend backend=Qgis::QueryStorageBackend::LocalProfile)
 Removes the stored query with matching name.
 
void storeQuery (const QString &name, const QString &query, Qgis::QueryStorageBackend backend=Qgis::QueryStorageBackend::LocalProfile)
 Saves a query to the manager.
 

Detailed Description

A manager for stored SQL queries.

QgsStoredQueryManager is not usually directly created, instead use the instance accessible through QgsGui::storedQueryManager().

Since
QGIS 3.44

Definition at line 32 of file qgsstoredquerymanager.h.

Constructor & Destructor Documentation

◆ QgsStoredQueryManager()

PRIVATE QgsStoredQueryManager::QgsStoredQueryManager ( QObject *  parent = nullptr)

Constructor for QgsStoredQueryManager, with the specified parent object.

Definition at line 28 of file qgsstoredquerymanager.cpp.

Member Function Documentation

◆ allQueries()

QList< QgsStoredQueryManager::QueryDetails > QgsStoredQueryManager::allQueries ( ) const

Returns details of all queries stored in the manager.

Queries will be sorted by name.

Definition at line 157 of file qgsstoredquerymanager.cpp.

◆ allQueryNames()

QStringList QgsStoredQueryManager::allQueryNames ( Qgis::QueryStorageBackend  backend = Qgis::QueryStorageBackend::LocalProfile) const

Returns a list of the names of all stored queries for the specified backend.

Definition at line 105 of file qgsstoredquerymanager.cpp.

◆ query()

QString QgsStoredQueryManager::query ( const QString &  name,
Qgis::QueryStorageBackend  backend = Qgis::QueryStorageBackend::LocalProfile 
) const

Returns the query definition with matching name, from the specified backend.

Definition at line 137 of file qgsstoredquerymanager.cpp.

◆ queryAdded

void QgsStoredQueryManager::queryAdded ( const QString &  name,
Qgis::QueryStorageBackend  backend 
)
signal

Emitted when a query is added to the manager.

◆ queryChanged

void QgsStoredQueryManager::queryChanged ( const QString &  name,
Qgis::QueryStorageBackend  backend 
)
signal

Emitted when an existing query is changed in the manager.

◆ queryRemoved

void QgsStoredQueryManager::queryRemoved ( const QString &  name,
Qgis::QueryStorageBackend  backend 
)
signal

Emitted when a query is removed from the manager.

◆ removeQuery()

void QgsStoredQueryManager::removeQuery ( const QString &  name,
Qgis::QueryStorageBackend  backend = Qgis::QueryStorageBackend::LocalProfile 
)

Removes the stored query with matching name.

Parameters
namename of query to remove
backendstorage backend for query
See also
queryRemoved()

Definition at line 73 of file qgsstoredquerymanager.cpp.

◆ storeQuery()

void QgsStoredQueryManager::storeQuery ( const QString &  name,
const QString &  query,
Qgis::QueryStorageBackend  backend = Qgis::QueryStorageBackend::LocalProfile 
)

Saves a query to the manager.

If a query with the same name already exists it will be overwritten with the new definition.

Parameters
nameuser-set, unique name for the query.
queryquery definition to store
backendstorage backend for query
See also
queryAdded()
queryChanged()

Definition at line 33 of file qgsstoredquerymanager.cpp.


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