QGIS/python/core/composer/qgsgroupungroupitemscommand.sip
Sandro Santilli a211c982cf Allow to undo/redo composer grouping/ungrouping
Fixes #11371 (crash on ungrouping after moving the group) and more
undo/redo related issues.

Enable pending test for the crash (now passing) and add many more
undo/redo related ones (including signals testing).

Includes a new QgsGroupUngroupItemsCommand class
and its SIP bindings.
2016-06-17 13:41:56 +02:00

44 lines
1.1 KiB
Plaintext

/** A composer command class for grouping / ungrouping composer items.
*
* If mState == Ungrouped, the command owns the group item
*/
class QgsGroupUngroupItemsCommand: QObject, QUndoCommand
{
%TypeHeaderCode
#include "qgsgroupungroupitemscommand.h"
%End
public:
/** Command kind, and state */
enum State
{
Grouped = 0,
Ungrouped
};
/** Create a group or ungroup command
*
* @param s command kind (@see State)
* @param item the group item being created or ungrouped
* @param c the composition including this group
* @param text command label
* @param parent parent command, if any
*
*/
QgsGroupUngroupItemsCommand( State s, QgsComposerItemGroup* item, QgsComposition* c, const QString& text, QUndoCommand* parent = nullptr );
~QgsGroupUngroupItemsCommand();
void redo();
void undo();
signals:
/** Signals addition of an item (the group) */
void itemAdded( QgsComposerItem* item );
/** Signals removal of an item (the group) */
void itemRemoved( QgsComposerItem* item );
};