DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickglow_p.h
1// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKGLOW_P_H
6#define DQUICKGLOW_P_H
7
8#include <dtkdeclarative_global.h>
9#include <DObject>
10
11#include <QQuickItem>
12
13DQUICK_BEGIN_NAMESPACE
14
15class DQuickGlowPrivate;
16class Q_DECL_EXPORT DQuickGlow : public QQuickItem
17{
18 Q_OBJECT
19 Q_PROPERTY(qreal glowRadius READ glowRadius WRITE setGlowRadius NOTIFY glowRadiusChanged)
20 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
21 Q_PROPERTY(qreal spread READ spread WRITE setSpread NOTIFY spreadChanged)
22 Q_PROPERTY(qreal relativeSizeX READ relativeSizeX WRITE setRelativeSizeX NOTIFY relativeSizeXChanged)
23 Q_PROPERTY(qreal relativeSizeY READ relativeSizeY WRITE setRelativeSizeY NOTIFY relativeSizeYChangd)
24 Q_PROPERTY(bool fill READ fill WRITE setFill NOTIFY fillChanged)
25
26#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
27 QML_NAMED_ELEMENT(GlowEffect)
28#endif
29public:
30 explicit DQuickGlow(QQuickItem *parent = nullptr);
31
32 qreal glowRadius() const;
33 void setGlowRadius(qreal radius);
34
35 QColor color() const;
36 void setColor(const QColor &);
37
38 qreal spread() const;
39 void setSpread(qreal radius);
40
41 qreal relativeSizeX() const;
42 void setRelativeSizeX(qreal x);
43
44 qreal relativeSizeY() const;
45 void setRelativeSizeY(qreal y);
46
47 bool fill();
48 void setFill(bool);
49Q_SIGNALS:
50 void glowRadiusChanged();
51 void colorChanged();
52 void spreadChanged();
53 void relativeSizeXChanged();
54 void relativeSizeYChangd();
55 void fillChanged();
56
57protected:
58 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
59
60protected:
61 DQuickGlow(DQuickGlowPrivate &dd, QQuickItem *parent = nullptr);
62
63private:
64 Q_DISABLE_COPY(DQuickGlow)
65 Q_DECLARE_PRIVATE(DQuickGlow)
66};
67
68DQUICK_END_NAMESPACE
69
70#endif // DQUICKGLOW_P_H
Definition dquickglow_p_p.h:15
Definition dquickglow_p.h:17