19#include "moc_qgslayoutitemgroupundocommand.cpp"
25QgsLayoutItemGroupUndoCommand::QgsLayoutItemGroupUndoCommand( State s,
QgsLayoutItemGroup *group,
QgsLayout *layout,
const QString &text, QUndoCommand *parent )
26 : QUndoCommand( text, parent )
27 , mGroupUuid( group->uuid() )
31 const QList< QgsLayoutItem * > items = group->
items();
34 mItemUuids.insert( i->uuid() );
38void QgsLayoutItemGroupUndoCommand::redo()
48void QgsLayoutItemGroupUndoCommand::undo()
58void QgsLayoutItemGroupUndoCommand::switchState()
60 if ( mState == Grouped )
64 Q_ASSERT_X( group,
"QgsLayoutItemGroupUndoCommand::switchState",
"Could not find group" );
66 mLayout->removeLayoutItemPrivate( group );
76 mLayout->addLayoutItemPrivate( group );
79 for (
const QString &childUuid : std::as_const( mItemUuids ) )
87 mLayout->project()->setDirty(
true );
A container for grouping several QgsLayoutItems.
void removeItems()
Removes all items from the group (but does not delete them).
void addItem(QgsLayoutItem *item)
Adds an item to the group.
QList< QgsLayoutItem * > items() const
Returns a list of items contained by the group.
Base class for graphical items within a QgsLayout.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.