4 #include "model/object.h" 5 #include "model/line.h" 8 #include <QGraphicsItem> 9 #include <QGraphicsRectItem> 13 #include <QStyleOptionGraphicsItem> 46 virtual const Object *
get()
const;
47 Entity *getModelParent()
const;
127 void keyPressEvent(QKeyEvent *event)
override;
145 QVariant
itemChange(GraphicsItemChange change,
const QVariant &value)
161 void paint(QPainter*,
const QStyleOptionGraphicsItem*, QWidget*)
override;
172 void moveHandlesAbove();
181 bool cosmetic =
false;
182 bool hovered =
false;
211 QVariant
itemChange(QGraphicsItem::GraphicsItemChange change,
212 const QVariant &value)
override;
219 void mousePressEvent(QGraphicsSceneMouseEvent *event)
override;
233 QPointF _dragStartPos;
The abstract base class for all objects in a sheet.
Definition: object.h:21
virtual void reloadFromModel()
Update the graphical representation to match the object from the model.
virtual void handleChanged(GObjectHandle *handle)
Called when a handle's position has changed.
A specialized QGraphicsScene containing a sheet of paper.
Definition: sheetscene.h:27
static GObject * assign(Object *obj)
Return a dynamically allocated GObject wrapping the specified object.
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
Process item changes that should behave uniformly across different object types.
GCompositeObject * parentItem() const
Return the parent item cast to a GObject*.
virtual void setCosmetic(bool cosmetic)
Make the object's pen independent of any transformations.
Object * obj
The object that is being wrapped.
Definition: gobject.h:177
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
QRectF boundingRect() const override
Default implementation that returns childrenBoundingRect().
bool isHovered() const
Return whether the mouse is over this object.
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
Disable the bool hovered so that it can be used by paint.
A graphical object that wraps a CompositeObject.
Definition: gcompositeobject.h:11
Base class for entities.
Definition: entity.h:32
The base class of all objects represented in a graphical scene.
Definition: gobject.h:24
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
Set hovered=true so that it can be used by paint.
virtual void applyToModel()
Apply changes to the underlying model object.
The base class for object handles.
Definition: gobject.h:194
QList< GObjectHandle * > * handles
Dynamically allocated list of handles.
Definition: gobject.h:179
GObject(Object *obj)
Construct a wrapper around obj.
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
virtual void showHandles(bool show=true)
Display/hide the handles for this item.