mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Metatype QgsHistoryEntry
This commit is contained in:
parent
ae5808f4b2
commit
d5cd4c99fc
@ -23,6 +23,11 @@ Encapsulates a history entry.
|
||||
%End
|
||||
public:
|
||||
|
||||
QgsHistoryEntry();
|
||||
%Docstring
|
||||
Constructor for an invalid entry.
|
||||
%End
|
||||
|
||||
QgsHistoryEntry( const QString &providerId, const QDateTime ×tamp, const QVariantMap &entry );
|
||||
%Docstring
|
||||
Constructor for QgsHistoryEntry ``entry``, with the specified ``providerId`` and ``timestamp``.
|
||||
@ -33,6 +38,13 @@ Constructor for QgsHistoryEntry ``entry``, with the specified ``providerId`` and
|
||||
Constructor for QgsHistoryEntry ``entry``.
|
||||
|
||||
The entry timestamp will be automatically set to the current date/time.
|
||||
%End
|
||||
|
||||
bool isValid() const;
|
||||
%Docstring
|
||||
Returns ``True`` if the entry is valid.
|
||||
|
||||
.. versionadded:: 3.32
|
||||
%End
|
||||
|
||||
QDateTime timestamp;
|
||||
@ -49,6 +61,7 @@ The entry timestamp will be automatically set to the current date/time.
|
||||
|
||||
};
|
||||
|
||||
|
||||
class QgsHistoryProviderRegistry : QObject
|
||||
{
|
||||
%Docstring(signature="appended")
|
||||
|
@ -44,6 +44,11 @@ QgsHistoryEntry::QgsHistoryEntry( const QVariantMap &entry )
|
||||
|
||||
}
|
||||
|
||||
bool QgsHistoryEntry::isValid() const
|
||||
{
|
||||
return !providerId.isEmpty();
|
||||
}
|
||||
|
||||
//
|
||||
// QgsHistoryProviderRegistry
|
||||
//
|
||||
|
@ -41,6 +41,11 @@ class GUI_EXPORT QgsHistoryEntry
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor for an invalid entry.
|
||||
*/
|
||||
QgsHistoryEntry() = default;
|
||||
|
||||
/**
|
||||
* Constructor for QgsHistoryEntry \a entry, with the specified \a providerId and \a timestamp.
|
||||
*/
|
||||
@ -53,6 +58,13 @@ class GUI_EXPORT QgsHistoryEntry
|
||||
*/
|
||||
QgsHistoryEntry( const QVariantMap &entry );
|
||||
|
||||
/**
|
||||
* Returns TRUE if the entry is valid.
|
||||
*
|
||||
* \since QGIS 3.32
|
||||
*/
|
||||
bool isValid() const;
|
||||
|
||||
//! Entry timestamp
|
||||
QDateTime timestamp;
|
||||
|
||||
@ -77,6 +89,8 @@ class GUI_EXPORT QgsHistoryEntry
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( QgsHistoryEntry );
|
||||
|
||||
/**
|
||||
* The QgsHistoryProviderRegistry is a registry for objects which track user history (i.e. operations performed through the GUI).
|
||||
*
|
||||
|
@ -325,6 +325,8 @@ QgsGui::QgsGui()
|
||||
mWidgetStateHelper = new QgsWidgetStateHelper();
|
||||
mProcessingRecentAlgorithmLog = new QgsProcessingRecentAlgorithmLog();
|
||||
mProcessingGuiRegistry = new QgsProcessingGuiRegistry();
|
||||
|
||||
qRegisterMetaType< QgsHistoryEntry >( "QgsHistoryEntry" );
|
||||
}
|
||||
|
||||
bool QgsGui::pythonMacroAllowed( void ( *lambda )(), QgsMessageBar *messageBar )
|
||||
|
Loading…
x
Reference in New Issue
Block a user