QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgshistoryentry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgshistoryentry.h
3 --------------------------
4 begin : April 2019
5 copyright : (C) 2019 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSHISTORYENTRY_H
17#define QGSHISTORYENTRY_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
21#include "qgis_sip.h"
22
23#include <QDateTime>
24#include <QMap>
25#include <QString>
26#include <QVariant>
27
28using namespace Qt::StringLiterals;
29
36class GUI_EXPORT QgsHistoryEntry
37{
38 public:
42 QgsHistoryEntry() = default;
43
47 explicit QgsHistoryEntry( const QString &providerId, const QDateTime &timestamp, const QVariantMap &entry );
48
54 explicit QgsHistoryEntry( const QVariantMap &entry );
55
61 bool isValid() const;
62
68 long long id = 0;
69
71 QDateTime timestamp;
72
74 QString providerId;
75
82 QVariantMap entry;
83
84#ifdef SIP_RUN
85 SIP_PYOBJECT __repr__();
86 //%MethodCode
87 const QString str = u"<QgsHistoryEntry: %1 %2>"_s.arg( sipCpp->providerId, sipCpp->timestamp.toString( Qt::ISODate ) );
88 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
89 //%End
90#endif
91};
92
94
95#endif // QGSHISTORYENTRY
Encapsulates a history entry.
bool isValid() const
Returns true if the entry is valid.
QgsHistoryEntry()=default
Constructor for an invalid entry.
QDateTime timestamp
Entry timestamp.
QString providerId
Associated history provider ID.
QVariantMap entry
Entry details.
Q_DECLARE_METATYPE(QgsHistoryEntry)