mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -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;
|
virtual QString id() const = 0;
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the provider's unique id, which is used to associate existing history entries with the provider.
|
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
|
%End
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -17,3 +17,13 @@
|
|||||||
#include "qgshistoryprovider.h"
|
#include "qgshistoryprovider.h"
|
||||||
|
|
||||||
QgsAbstractHistoryProvider::~QgsAbstractHistoryProvider() = default;
|
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;
|
virtual QString id() const = 0;
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new history node for the given \a entry.
|
* Creates a new history node for the given \a entry.
|
||||||
|
*
|
||||||
|
* \since QGIS 3.32
|
||||||
*/
|
*/
|
||||||
virtual QgsHistoryEntryNode *createNodeForEntry( const QVariantMap &entry ) = 0 SIP_FACTORY;
|
virtual QgsHistoryEntryNode *createNodeForEntry( const QVariantMap &entry ) SIP_FACTORY;
|
||||||
#endif
|
|
||||||
|
/**
|
||||||
|
* 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
|
#endif //QGSHISTORYPROVIDER_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user