Schim
Public Member Functions | List of all members
GCompositeObject Class Reference

A graphical object that wraps a CompositeObject. More...

#include <gcompositeobject.h>

Inheritance diagram for GCompositeObject:
[legend]
Collaboration diagram for GCompositeObject:
[legend]

Public Member Functions

CompositeObjectget () override
 Return the object that is being wrapped by this class. More...
 
void setCosmetic (bool cosmetic) override
 Construct a wrapper around obj. More...
 
void applyToModel () override
 Apply changes to the underlying model object. More...
 
void reloadFromModel () override
 Update the graphical representation to match the object from the model. More...
 
- Public Member Functions inherited from GObject
 GObject (Object *obj)
 Construct a wrapper around obj. More...
 
virtual ~GObject ()
 
bool isHovered () const
 Return whether the mouse is over this object.
 
virtual void showHandles (bool show=true)
 Display/hide the handles for this item. More...
 
virtual void handleChanged (GObjectHandle *handle)
 Called when a handle's position has changed. More...
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 Set hovered=true so that it can be used by paint.
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 Disable the bool hovered so that it can be used by paint.
 
QRectF boundingRect () const override
 Default implementation that returns childrenBoundingRect().
 
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
 
GCompositeObjectparentItem () const
 Return the parent item cast to a GObject*.
 

Additional Inherited Members

- Static Public Member Functions inherited from GObject
static GObjectassign (Object *obj)
 Return a dynamically allocated GObject wrapping the specified object. More...
 
- Protected Member Functions inherited from GObject
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 Process item changes that should behave uniformly across different object types. More...
 
- Protected Attributes inherited from GObject
Objectobj
 The object that is being wrapped.
 
QList< GObjectHandle * > * handles {}
 Dynamically allocated list of handles.
 

Detailed Description

A graphical object that wraps a CompositeObject.

Member Function Documentation

◆ applyToModel()

void GCompositeObject::applyToModel ( )
overridevirtual

Apply changes to the underlying model object.

Note
The base implementation does nothing and should be implemented in derived classes.

Reimplemented from GObject.

Reimplemented in GLinearObjectArray.

◆ get()

CompositeObject* GCompositeObject::get ( )
overridevirtual

Return the object that is being wrapped by this class.

Note
Derived classes should change the return type of this method to match the type of the object that is wrapped by them.

Reimplemented from GObject.

Reimplemented in GHeader, and GLinearObjectArray.

◆ reloadFromModel()

void GCompositeObject::reloadFromModel ( )
overridevirtual

Update the graphical representation to match the object from the model.

Note
The base implementation does nothing and should be implemented in derived classes.

Reimplemented from GObject.

Reimplemented in GLinearObjectArray.

◆ setCosmetic()

void GCompositeObject::setCosmetic ( bool  cosmetic)
overridevirtual

Construct a wrapper around obj.

The object is movable, selectable and sends geometry changes by default. Hover events are accepted.

For correct behavior, call this method only after the object has been added to a scene. This will ensure that it is applied to all children of the object.

Reimplemented from GObject.


The documentation for this class was generated from the following file: