1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICKPATHINTERPOLATOR_P_H |
5 | #define QQUICKPATHINTERPOLATOR_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <private/qtquickglobal_p.h> |
19 | |
20 | QT_REQUIRE_CONFIG(quick_path); |
21 | |
22 | #include <qqml.h> |
23 | #include <QObject> |
24 | |
25 | QT_BEGIN_NAMESPACE |
26 | |
27 | class QQuickPath; |
28 | class Q_QUICK_PRIVATE_EXPORT QQuickPathInterpolator : public QObject |
29 | { |
30 | Q_OBJECT |
31 | Q_PROPERTY(QQuickPath *path READ path WRITE setPath NOTIFY pathChanged FINAL) |
32 | Q_PROPERTY(qreal progress READ progress WRITE setProgress NOTIFY progressChanged FINAL) |
33 | Q_PROPERTY(qreal x READ x NOTIFY xChanged FINAL) |
34 | Q_PROPERTY(qreal y READ y NOTIFY yChanged FINAL) |
35 | Q_PROPERTY(qreal angle READ angle NOTIFY angleChanged FINAL) |
36 | QML_NAMED_ELEMENT(PathInterpolator) |
37 | QML_ADDED_IN_VERSION(2, 0) |
38 | public: |
39 | explicit QQuickPathInterpolator(QObject *parent = nullptr); |
40 | |
41 | QQuickPath *path() const; |
42 | void setPath(QQuickPath *path); |
43 | |
44 | qreal progress() const; |
45 | void setProgress(qreal progress); |
46 | |
47 | qreal x() const; |
48 | qreal y() const; |
49 | qreal angle() const; |
50 | |
51 | Q_SIGNALS: |
52 | void pathChanged(); |
53 | void progressChanged(); |
54 | void xChanged(); |
55 | void yChanged(); |
56 | void angleChanged(); |
57 | |
58 | private Q_SLOTS: |
59 | void _q_pathUpdated(); |
60 | |
61 | private: |
62 | QQuickPath *_path; |
63 | qreal _x; |
64 | qreal _y; |
65 | qreal _angle; |
66 | qreal _progress; |
67 | }; |
68 | |
69 | QT_END_NAMESPACE |
70 | |
71 | QML_DECLARE_TYPE(QQuickPathInterpolator) |
72 | |
73 | #endif // QQUICKPATHINTERPOLATOR_P_H |
74 |