QGIS API Documentation 3.43.0-Master (ebb4087afc0)
|
A manager for stored SQL queries. More...
#include <qgsstoredquerymanager.h>
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::QueryDetails > | allQueries () 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. | |
A manager for stored SQL queries.
QgsStoredQueryManager is not usually directly created, instead use the instance accessible through QgsGui::storedQueryManager().
Definition at line 32 of file qgsstoredquerymanager.h.
PRIVATE QgsStoredQueryManager::QgsStoredQueryManager | ( | QObject * | parent = nullptr | ) |
Constructor for QgsStoredQueryManager, with the specified parent object.
Definition at line 28 of file qgsstoredquerymanager.cpp.
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.
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.
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.
|
signal |
Emitted when a query is added to the manager.
|
signal |
Emitted when an existing query is changed in the manager.
|
signal |
Emitted when a query is removed from the manager.
void QgsStoredQueryManager::removeQuery | ( | const QString & | name, |
Qgis::QueryStorageBackend | backend = Qgis::QueryStorageBackend::LocalProfile |
||
) |
Removes the stored query with matching name.
name | name of query to remove |
backend | storage backend for query |
Definition at line 73 of file qgsstoredquerymanager.cpp.
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.
name | user-set, unique name for the query. |
query | query definition to store |
backend | storage backend for query |
Definition at line 33 of file qgsstoredquerymanager.cpp.