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

Graphical line object that wraps a Line. More...

#include <gline.h>

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

Public Member Functions

Lineget () override
 Return the object that is being wrapped by this class. More...
 
void reloadFromModel () override
 Update the graphical representation to match the object from the model. More...
 
void applyToModel () override
 Apply changes to the underlying model object. More...
 
void handleChanged (GObjectHandle *handle) override
 Called when a handle's position has changed. More...
 
void showHandles (bool show=true) override
 Display/hide the handles for this item. 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 setCosmetic (bool cosmetic)
 Make the object's pen independent of any transformations. 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

Graphical line object that wraps a Line.

Member Function Documentation

◆ applyToModel()

void GLine::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.

◆ get()

Line* GLine::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.

◆ handleChanged()

void GLine::handleChanged ( GObjectHandle handle)
overridevirtual

Called when a handle's position has changed.

The base implementation does nothing.

Parameters
handleThe handle that has been modified.

Reimplemented from GObject.

◆ reloadFromModel()

void GLine::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.

◆ showHandles()

void GLine::showHandles ( bool  show = true)
overridevirtual

Display/hide the handles for this item.

The list of handles is dynamically allocated and it exists only while the handles are visible. This way, the handles do not take up memory when they are not used.

Note
The base version of this method implements only the deletion of handles, i.e. when show = true. Each subclass should implement this this method separately, optionally calling the superclass method but only as the last statement.

Reimplemented from GObject.


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