QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgslayoutitemgroupundocommand.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutitemgroupundocommand.h
3 -------------------------------
4 begin : 2016-06-09
5 copyright : (C) 2016 by Sandro Santilli
6 email : strk at kbt dot io
7***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSLAYOUTITEMGROUPUNDOCOMMAND_H
19#define QGSLAYOUTITEMGROUPUNDOCOMMAND_H
20
21#include "qgis_core.h"
22#include <QUndoCommand>
23#include "qgslayoutitem.h"
24
25#define SIP_NO_FILE
27
32class CORE_EXPORT QgsLayoutItemGroupUndoCommand: public QObject, public QUndoCommand
33{
34 Q_OBJECT
35
36 public:
37
39 enum State
40 {
41 Grouped = 0,
42 Ungrouped
43 };
44
55 QgsLayoutItemGroupUndoCommand( State s, QgsLayoutItemGroup *group, QgsLayout *layout,
56 const QString &text, QUndoCommand *parent = nullptr );
57
58 void redo() override;
59 void undo() override;
60
61 private:
62 QString mGroupUuid;
63 QSet<QString> mItemUuids;
64 QgsLayout *mLayout = nullptr;
65 State mState;
67 bool mFirstRun = true;
68
69 //changes between added / removed state
70 void switchState();
71};
73
74#endif // QGSLAYOUTITEMGROUPUNDOCOMMAND_H
A container for grouping several QgsLayoutItems.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:49