30 #include "../../../../core/pattern/mvc/ItemObserver.h"
31 #include "../../../../core/enum/EnumType.h"
32 #include "../../../../core/pattern/mvc/Observable.h"
33 #include "../../Scene.h"
36 #include <QGraphicsScene>
37 #include <QGraphicsItem>
45 foreach( QGraphicsItem *item,
m_items )
47 item->setSelected(
false);
52 setText(QObject::tr(
"Delete %1")
68 foreach( QGraphicsItem *item, m_items )
70 item->setSelected(
false);
72 if(item->scene() != m_scene)
89 foreach( QGraphicsItem *item, m_items )
91 if(item->scene() == m_scene)
93 m_scene->removeItem(item);
101 return QObject::tr(
"%1")
virtual ~DeleteCommand()
Destructor.
virtual void undo()
Reimplemented from QUndoCommand.
virtual void redo()
Reimplemented from QUndoCommand.
virtual QString createCommandString(int totalItems)
virtual bool addItemStackWithoutScene(QGraphicsItem *item)
Undo/Redo for delete one or more components.
Class representing the scene. This scene is child of QGraphicsScene, part of Graphics View Framework...
DeleteCommand(QGraphicsScene *scene, QUndoCommand *parent=0)
Constructor.
virtual bool removeItemStackWithoutScene(QGraphicsItem *item)
virtual void insertItem(ItemObserver *item)
Method that inserts a graphic object in the scene. Inverts the matrix of the object if necessary...
QList< QGraphicsItem * > m_items