QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsmodelundocommand.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmodelundocommand.h
3 ----------------------------------
4 Date : March 2020
5 Copyright : (C) 2020 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSMODELUNDOCOMMAND_H
17#define QGSMODELUNDOCOMMAND_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
21
22#include <QUndoCommand>
23
24class QgsProcessingModelAlgorithm;
25
26#define SIP_NO_FILE
27
29
36class GUI_EXPORT QgsModelUndoCommand : public QUndoCommand
37{
38 public:
39 QgsModelUndoCommand( QgsProcessingModelAlgorithm *model, const QString &text, int id = 0, QUndoCommand *parent SIP_TRANSFERTHIS = nullptr );
40
44 void saveAfterState();
45
46 int id() const override;
47 void undo() override;
48 void redo() override;
49 bool mergeWith( const QUndoCommand *other ) override;
50
51 private:
53 bool mFirstRun = true;
54
55 QgsProcessingModelAlgorithm *mModel = nullptr;
56 QVariant mBeforeState;
57 QVariant mAfterState;
58 int mId = 0;
59};
60
62
63#endif // QGSMODELUNDOCOMMAND_H
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53