51 #include <QGraphicsItem> 52 #include <QGraphicsSceneMouseEvent> 54 #include "../parser/element.hh" 55 #include "elementArea.hh" 56 #include "graphicsScene.hh" 57 #include "sceneElement.hh" 86 return elementsBoundingRect_;
94 foreach (QGraphicsItem *e, elements_)
95 e->setSelected (
false);
97 elements_.append (_element);
98 _element->setParentItem (
this);
99 prepareGeometryChange ();
100 elementsBoundingRect_ = _element->boundingRect () | _element->childrenBoundingRect ();
102 _element->setSelected (
true);
112 if (!_force && _element->
element ()->
flags () & ELEMENT_FLAG_NO_DELETE)
114 if (elements_.contains (_element))
116 elements_.removeAll (_element);
117 _element->setParentItem (0);
118 prepareGeometryChange();
119 elementsBoundingRect_ = childrenBoundingRect();
unsigned int flags() const
Flags.
bool removeElement(SceneElement *_element, bool _force=false)
Remove an element, if its removeable or _force is set.
void addElement(SceneElement *_element)
Add a child element.
QRectF boundingRect() const
Bounding rectangle.
ElementArea(GraphicsScene *_scene)
Constructor.
Element * element() const
Context VSI::Element.
~ElementArea()
Destructor.
const QList< SceneElement * > & elements() const
All elements.