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(corners)
10 QML_CONSTRUCTIBLE_VALUE
11
12 Q_PROPERTY(qreal topLeft READ topLeft WRITE setTopLeft FINAL)
13 Q_PROPERTY(qreal topRight READ topRight WRITE setTopRight FINAL)
14 Q_PROPERTY(qreal bottomLeft READ bottomLeft WRITE setBottomLeft FINAL)
15 Q_PROPERTY(qreal bottomRight READ bottomRight WRITE setBottomRight FINAL)
16
17public:
18 Q_INVOKABLE CornersGroup() noexcept;
19 Q_INVOKABLE CornersGroup(qreal) noexcept;
20 Q_INVOKABLE CornersGroup(qreal bottomRight, qreal topRight, qreal bottomLeft,
21 qreal topLeft) noexcept;
22 ~CornersGroup();
23
24 CornersGroup(const CornersGroup&) = default;
25 CornersGroup(CornersGroup&&) = default;
26 CornersGroup& operator=(const CornersGroup&) = default;
27 CornersGroup& operator=(CornersGroup&&) = default;
28
29 Q_INVOKABLE qreal radius() const noexcept;
30 void setRadius(qreal) noexcept;
31
32 qreal topLeft() const noexcept;
33 void setTopLeft(qreal newTopLeft) noexcept;
34
35 qreal topRight() const noexcept;
36 void setTopRight(qreal newTopRight) noexcept;
37
38 qreal bottomLeft() const noexcept;
39 void setBottomLeft(qreal newBottomLeft) noexcept;
40
41 qreal bottomRight() const noexcept;
42 void setBottomRight(qreal newBottomRight) noexcept;
43
44 Q_INVOKABLE QVector4D toVector4D() const noexcept;
45 operator QVector4D() const noexcept;
46
47private:
48 double m_bottomRight;
49 double m_topRight;
50 double m_bottomLeft;
51 double m_topLeft;
52};
53
54} // namespace qml_material