DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickwaterprogressattribute_p.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKWATERPROGRESSATTRIBUTE_P_H
6#define DQUICKWATERPROGRESSATTRIBUTE_P_H
7
8#include <dtkdeclarative_global.h>
9
10#include <DObject>
11#include <QQmlListProperty>
12#include <QObject>
13#include <QSharedDataPointer>
14#include <QtQml/qqml.h>
15
16class QQuickItem;
17DQUICK_BEGIN_NAMESPACE
18class WaterPopAttributePrivate;
19class WaterPopAttribute : public QObject
20{
21 Q_OBJECT
22 Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged FINAL)
23 Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged FINAL)
24 Q_PROPERTY(qreal xSpeed READ xSpeed WRITE setXSpeed NOTIFY xSpeedChanged FINAL)
25 Q_PROPERTY(qreal ySpeed READ ySpeed WRITE setYSpeed NOTIFY ySpeedChanged FINAL)
26 Q_PROPERTY(qreal x READ x WRITE setX NOTIFY xChanged FINAL)
27 Q_PROPERTY(qreal y READ y WRITE setY NOTIFY yChanged FINAL)
28#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
29 QML_ANONYMOUS
30#endif
31
32public:
33 WaterPopAttribute(qreal sizeRatio = 0, qreal xSpeed = 0, qreal ySpeed = 0);
35
37 WaterPopAttribute& operator=(const WaterPopAttribute &other);
38
39 qreal xSpeed() const;
40 void setXSpeed(qreal popXSpeed);
41
42 qreal ySpeed() const;
43 void setYSpeed(qreal popYSpeed);
44
45 qreal x() const;
46 void setX(qreal x);
47
48 qreal y() const;
49 void setY(qreal y);
50
51 qreal width() const;
52 void setWidth(qreal width);
53
54 qreal height() const;
55 void setHeight(qreal height);
56
57 qreal sizeRatio() const;
58
59 inline qreal yOffset() const;
60 inline void setYOffset(qreal offset);
61
62Q_SIGNALS:
63 void xSpeedChanged();
64 void ySpeedChanged();
65 void xChanged();
66 void yChanged();
67 void widthChanged();
68 void heightChanged();
69
70private:
71 QSharedDataPointer<WaterPopAttributePrivate> d;
72};
73
75class DQuickWaterProgressAttribute : public QObject, DCORE_NAMESPACE::DObject
76{
77 Q_OBJECT
78 D_DECLARE_PRIVATE(DQuickWaterProgressAttribute)
79 Q_PROPERTY(qreal frontXOffset READ frontXOffset NOTIFY frontXOffsetChanged)
80 Q_PROPERTY(qreal backXOffset READ backXOffset NOTIFY backXOffsetChanged)
81 Q_PROPERTY(qreal imageWidth READ imageWidth WRITE setImageWidth NOTIFY imageWidthChanged)
82 Q_PROPERTY(qreal imageHeight READ imageHeight WRITE setImageHeight NOTIFY imageHeightChanged)
83 Q_PROPERTY(QQmlListProperty<DTK_QUICK_NAMESPACE::WaterPopAttribute> pops READ pops NOTIFY popsChanged)
84 Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged)
85 Q_PROPERTY(QQuickItem *waterProgress READ waterProgress WRITE setWaterProgress NOTIFY waterProgressChanged)
86#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
87 QML_NAMED_ELEMENT(WaterProgressAttribute)
88#endif
89
90public:
91 explicit DQuickWaterProgressAttribute(QObject *parent = nullptr);
93
94 qreal frontXOffset() const;
95 void setFrontXOffset(qreal frontXOffset);
96
97 qreal backXOffset() const;
98 void setBackXOffset(qreal backXOffset);
99
100 QQmlListProperty<WaterPopAttribute> pops();
101
102 bool running() const;
103 void setRunning(bool running);
104
105 QQuickItem * waterProgress() const;
106 void setWaterProgress(QQuickItem * waterProgress);
107
108 qreal imageWidth() const;
109 void setImageWidth(qreal imageWidth);
110
111 qreal imageHeight() const;
112 void setImageHeight(qreal imageHeight);
113
114Q_SIGNALS:
115 void frontXOffsetChanged();
116 void backXOffsetChanged();
117 void popsChanged();
118 void runningChanged();
119 void waterProgressChanged();
120 void imageWidthChanged();
121 void imageHeightChanged();
122};
123
124DQUICK_END_NAMESPACE
125#endif // DQUICKWATERPROGRESSATTRIBUTE_H
Definition dquickwaterprogressattribute.cpp:157
Definition dquickwaterprogressattribute_p.h:76
Definition dquickwaterprogressattribute_p.h:20