-
Notifications
You must be signed in to change notification settings - Fork 0
/
line.h
44 lines (31 loc) · 991 Bytes
/
line.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef LINE_H
#define LINE_H
#include <QQuickItem>
class Line : public QQuickItem
{
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(float relativeX READ relativeX WRITE setRelativeX NOTIFY relativeXChanged FINAL)
Q_PROPERTY(float relativeY READ relativeY WRITE setRelativeY NOTIFY relativeYChanged FINAL)
Q_PROPERTY(QPointF scenePos READ scenePos WRITE setScenePos NOTIFY scenePosChanged FINAL)
public:
Line();
float relativeX() const;
void setRelativeX(float newRelativeX);
float relativeY() const;
void setRelativeY(float newRelativeY);
QPointF scenePos() const;
void setScenePos(QPointF newScenePos);
signals:
// QQuickItem interface
void relativeXChanged();
void relativeYChanged();
void scenePosChanged();
protected:
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
private:
float m_relativeX;
float m_relativeY;
QPointF m_scenePos;
};
#endif // LINE_H