QGIS API Documentation 3.99.0-Master (c22de0620c0)
Loading...
Searching...
No Matches
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 "qgslayoutitem.h"
23
24#include <QUndoCommand>
25
26#define SIP_NO_FILE
27
29
34class CORE_EXPORT QgsLayoutItemGroupUndoCommand: public QObject, public QUndoCommand
35{
36 Q_OBJECT
37
38 public:
39
41 enum State
42 {
43 Grouped = 0,
44 Ungrouped
45 };
46
57 QgsLayoutItemGroupUndoCommand( State s, QgsLayoutItemGroup *group, QgsLayout *layout,
58 const QString &text, QUndoCommand *parent = nullptr );
59
60 void redo() override;
61 void undo() override;
62
63 private:
64 QString mGroupUuid;
65 QSet<QString> mItemUuids;
66 QgsLayout *mLayout = nullptr;
67 State mState;
69 bool mFirstRun = true;
70
71 //changes between added / removed state
72 void switchState();
73};
75
76#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:50