Schim
gline.h
Go to the documentation of this file.
1 #ifndef GLINE_H
3 #define GLINE_H
4 
5 #include "model/object.h"
6 #include "model/line.h"
7 #include "ui/objects/gobject.h"
8 
9 #include <QGraphicsLineItem>
10 #include <QVariant>
11 
15 class GLine : public GObject
16 {
17 public:
18  // CONSTRUCTORS
19  explicit GLine(Line *obj = new Line);
20 
21  // GETTERS
22  Line *get() override;
23  const Line *get() const override;
24 
25  // OBJECT EDITING
26  void reloadFromModel() override;
27  void applyToModel() override;
28  void handleChanged(GObjectHandle *handle) override;
29  void showHandles(bool show = true) override;
30 
31  // OVERRIDE QGraphicsItem
32  QRectF boundingRect() const override;
33 protected:
34  QPainterPath shape() const override;
35  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
36 };
37 
38 #endif // GLINE_H
void applyToModel() override
Apply changes to the underlying model object.
A visual line object.
Definition: line.h:16
void reloadFromModel() override
Update the graphical representation to match the object from the model.
Object * obj
The object that is being wrapped.
Definition: gobject.h:177
void handleChanged(GObjectHandle *handle) override
Called when a handle&#39;s position has changed.
void showHandles(bool show=true) override
Display/hide the handles for this item.
The base class of all objects represented in a graphical scene.
Definition: gobject.h:24
The base class for object handles.
Definition: gobject.h:194
Graphical line object that wraps a Line.
Definition: gline.h:15