mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Add capacity for history providers to create/update nodes
This commit is contained in:
parent
dd25f39479
commit
0774c80f3e
@ -36,6 +36,20 @@ Abstract base class for objects which track user history (i.e. operations perfor
|
||||
virtual QString id() const = 0;
|
||||
%Docstring
|
||||
Returns the provider's unique id, which is used to associate existing history entries with the provider.
|
||||
%End
|
||||
|
||||
virtual QgsHistoryEntryNode *createNodeForEntry( const QVariantMap &entry ) /Factory/;
|
||||
%Docstring
|
||||
Creates a new history node for the given ``entry``.
|
||||
|
||||
.. versionadded:: 3.32
|
||||
%End
|
||||
|
||||
virtual void updateNodeForEntry( QgsHistoryEntryNode *node, const QVariantMap &entry );
|
||||
%Docstring
|
||||
Updates an existing history ``node`` for the given ``entry``.
|
||||
|
||||
.. versionadded:: 3.32
|
||||
%End
|
||||
|
||||
};
|
||||
|
@ -17,3 +17,13 @@
|
||||
#include "qgshistoryprovider.h"
|
||||
|
||||
QgsAbstractHistoryProvider::~QgsAbstractHistoryProvider() = default;
|
||||
|
||||
QgsHistoryEntryNode *QgsAbstractHistoryProvider::createNodeForEntry( const QVariantMap & )
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void QgsAbstractHistoryProvider::updateNodeForEntry( QgsHistoryEntryNode *, const QVariantMap & )
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -52,13 +52,20 @@ class GUI_EXPORT QgsAbstractHistoryProvider
|
||||
*/
|
||||
virtual QString id() const = 0;
|
||||
|
||||
#if 0
|
||||
|
||||
/**
|
||||
* Creates a new history node for the given \a entry.
|
||||
*
|
||||
* \since QGIS 3.32
|
||||
*/
|
||||
virtual QgsHistoryEntryNode *createNodeForEntry( const QVariantMap &entry ) = 0 SIP_FACTORY;
|
||||
#endif
|
||||
virtual QgsHistoryEntryNode *createNodeForEntry( const QVariantMap &entry ) SIP_FACTORY;
|
||||
|
||||
/**
|
||||
* Updates an existing history \a node for the given \a entry.
|
||||
*
|
||||
* \since QGIS 3.32
|
||||
*/
|
||||
virtual void updateNodeForEntry( QgsHistoryEntryNode *node, const QVariantMap &entry );
|
||||
|
||||
};
|
||||
|
||||
#endif //QGSHISTORYPROVIDER_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user