The QgsHistoryProviderRegistry is a registry for objects which track user history (i.e.
More...
#include <qgshistoryproviderregistry.h>
|
| QgsHistoryProviderRegistry (QObject *parent=nullptr, bool useMemoryDatabase=false) |
| Creates a new empty history provider registry. More...
|
|
| ~QgsHistoryProviderRegistry () override |
|
void | addDefaultProviders () |
| Adds the default history providers to the registry. More...
|
|
bool | addEntries (const QList< QgsHistoryEntry > &entries, QgsHistoryProviderRegistry::HistoryEntryOptions options=QgsHistoryProviderRegistry::HistoryEntryOptions()) |
| Adds a list of entries to the history logs. More...
|
|
long long | addEntry (const QgsHistoryEntry &entry, bool &ok, QgsHistoryProviderRegistry::HistoryEntryOptions options=QgsHistoryProviderRegistry::HistoryEntryOptions()) |
| Adds an entry to the history logs. More...
|
|
long long | addEntry (const QString &providerId, const QVariantMap &entry, bool &ok, QgsHistoryProviderRegistry::HistoryEntryOptions options=QgsHistoryProviderRegistry::HistoryEntryOptions()) |
| Adds an entry to the history logs. More...
|
|
bool | addProvider (QgsAbstractHistoryProvider *provider) |
| Adds a provider to the registry. More...
|
|
bool | clearHistory (Qgis::HistoryProviderBackend backend) |
| Clears the history for the specified backend. More...
|
|
QgsHistoryEntry | entry (long long id, bool &ok, Qgis::HistoryProviderBackend backend=Qgis::HistoryProviderBackend::LocalProfile) const |
| Returns the entry with matching ID, from the specified backend. More...
|
|
QgsAbstractHistoryProvider * | providerById (const QString &id) |
| Returns the provider with matching id, or nullptr if no matching provider is registered. More...
|
|
QStringList | providerIds () const |
| Returns a list of the registered provider IDs. More...
|
|
QList< QgsHistoryEntry > | queryEntries (const QDateTime &start=QDateTime(), const QDateTime &end=QDateTime(), const QString &providerId=QString(), Qgis::HistoryProviderBackends backends=Qgis::HistoryProviderBackend::LocalProfile) const |
| Queries history entries which occurred between the specified start and end times. More...
|
|
bool | removeProvider (const QString &id) |
| Removes the provider with matching id. More...
|
|
bool | updateEntry (long long id, const QVariantMap &entry, Qgis::HistoryProviderBackend backend=Qgis::HistoryProviderBackend::LocalProfile) |
| Updates the existing entry with matching id. More...
|
|
The QgsHistoryProviderRegistry is a registry for objects which track user history (i.e.
operations performed through the GUI).
QgsHistoryProviderRegistry is not usually directly created, but rather accessed through QgsGui::historyProviderRegistry().
- Since
- QGIS 3.24
Definition at line 89 of file qgshistoryproviderregistry.h.
◆ QgsHistoryProviderRegistry()
QgsHistoryProviderRegistry::QgsHistoryProviderRegistry |
( |
QObject * |
parent = nullptr , |
|
|
bool |
useMemoryDatabase = false |
|
) |
| |
◆ ~QgsHistoryProviderRegistry()
QgsHistoryProviderRegistry::~QgsHistoryProviderRegistry |
( |
| ) |
|
|
override |
◆ addDefaultProviders()
void QgsHistoryProviderRegistry::addDefaultProviders |
( |
| ) |
|
◆ addEntries()
◆ addEntry() [1/2]
Adds an entry to the history logs.
- Parameters
-
entry | entry to add |
ok | will be set to true if entry was successfully added |
options | options |
- Returns
- ID of newly added entry.
Definition at line 119 of file qgshistoryproviderregistry.cpp.
◆ addEntry() [2/2]
Adds an entry to the history logs.
The entry will be tagged with the current date/time as the timestamp.
The providerId specifies the history provider responsible for this entry. Entry options are specified via the options argument.
- Parameters
-
- Returns
- ID of newly added entry.
Definition at line 114 of file qgshistoryproviderregistry.cpp.
◆ addProvider()
Adds a provider to the registry.
Ownership of the provider is transferred to the registry.
Returns true
if the provider was successfully added.
Definition at line 86 of file qgshistoryproviderregistry.cpp.
◆ clearHistory()
◆ entry()
Returns the entry with matching ID, from the specified backend.
- Parameters
-
id | ID of entry to find |
ok | will be set to true if entry was found |
backend | associated backend |
- Returns
- matching entry if found
Definition at line 158 of file qgshistoryproviderregistry.cpp.
◆ providerById()
◆ providerIds()
QStringList QgsHistoryProviderRegistry::providerIds |
( |
| ) |
const |
◆ queryEntries()
Queries history entries which occurred between the specified start and end times.
The optional providerId and backends arguments can be used to filter entries.
Definition at line 223 of file qgshistoryproviderregistry.cpp.
◆ removeProvider()
bool QgsHistoryProviderRegistry::removeProvider |
( |
const QString & |
id | ) |
|
Removes the provider with matching id.
The provider will be deleted.
Returns true
if the provider was successfully removed.
Definition at line 100 of file qgshistoryproviderregistry.cpp.
◆ updateEntry()
Updates the existing entry with matching id.
This method allows the content of an entry to be updated, e.g. to add additional properties to the content. (Such as recording the results of after a long-running operation completes).
Definition at line 200 of file qgshistoryproviderregistry.cpp.
◆ userHistoryDbPath()
QString QgsHistoryProviderRegistry::userHistoryDbPath |
( |
| ) |
|
|
static |
The documentation for this class was generated from the following files: