45 #include <QGraphicsItem> 46 #include <QGraphicsSceneMouseEvent> 48 #include "../parser/element.hh" 49 #include "elementArea.hh" 50 #include "graphicsScene.hh" 51 #include "sceneElement.hh" 80 return elementsBoundingRect_;
88 foreach (QGraphicsItem *e, elements_)
89 e->setSelected (
false);
91 elements_.append (_element);
92 _element->setParentItem (
this);
93 prepareGeometryChange ();
94 elementsBoundingRect_ = _element->boundingRect () | _element->childrenBoundingRect ();
96 _element->setSelected (
true);
106 if (!_force && _element->
element ()->
flags () & ELEMENT_FLAG_NO_DELETE)
108 if (elements_.contains (_element))
110 elements_.removeAll (_element);
111 _element->setParentItem (0);
112 prepareGeometryChange();
113 elementsBoundingRect_ = childrenBoundingRect();
unsigned int flags() const
Flags.
void addElement(SceneElement *_element)
Add a child element.
~ElementArea()
Destructor.
QRectF boundingRect() const
Bounding rectangle.
ElementArea(GraphicsScene *_scene)
Constructor.
const QList< SceneElement * > & elements() const
All elements.
bool removeElement(SceneElement *_element, bool _force=false)
Remove an element, if its removeable or _force is set.
Element * element() const
Context VSI::Element.