QmlMaterial 0.1.0
Loading...
Searching...
No Matches
corner.hpp
1#pragma once
2#include <QQmlEngine>
3#include <QVector4D>
4
5namespace qml_material
6{
7class CornersGroup {
8 Q_GADGET
9 QML_VALUE_TYPE(t_corner)
10
11 Q_PROPERTY(qreal topLeft READ topLeft WRITE setTopLeft FINAL)
12 Q_PROPERTY(qreal topRight READ topRight WRITE setTopRight FINAL)
13 Q_PROPERTY(qreal bottomLeft READ bottomLeft WRITE setBottomLeft FINAL)
14 Q_PROPERTY(qreal bottomRight READ bottomRight WRITE setBottomRight FINAL)
15
16public:
17 CornersGroup();
18 CornersGroup(qreal);
19 CornersGroup(qreal bottomRight, qreal topRight, qreal bottomLeft, qreal topLeft);
20 ~CornersGroup();
21
22 Q_INVOKABLE CornersGroup& operator=(qreal) { return *this; }
23
24 Q_INVOKABLE qreal radius() const;
25 void setRadius(qreal);
26
27 qreal topLeft() const;
28 void setTopLeft(qreal newTopLeft);
29
30 qreal topRight() const;
31 void setTopRight(qreal newTopRight);
32
33 qreal bottomLeft() const;
34 void setBottomLeft(qreal newBottomLeft);
35
36 qreal bottomRight() const;
37 void setBottomRight(qreal newBottomRight);
38
39 Q_INVOKABLE QVector4D toVector4D() const noexcept;
40 operator QVector4D() const noexcept;
41
42private:
43 double m_bottomRight;
44 double m_topRight;
45 double m_bottomLeft;
46 double m_topLeft;
47};
48
49} // namespace qml_material