DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickcoloroverlay_p.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKCOLOROVERLAY_P_H
6#define DQUICKCOLOROVERLAY_P_H
7
8#include <dtkdeclarative_global.h>
9
10#include <QQuickItem>
11
12DQUICK_BEGIN_NAMESPACE
13
14class DQuickColorOverlayPrivate;
15class DQuickColorOverlay : public QQuickItem
16{
17 Q_OBJECT
18 Q_DISABLE_COPY(DQuickColorOverlay)
19 Q_DECLARE_PRIVATE(DQuickColorOverlay)
20 Q_PROPERTY(QQuickItem *source READ source WRITE setSource NOTIFY sourceChanged)
21 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
22 Q_PROPERTY(bool cached READ cached WRITE setCached NOTIFY cachedChanged)
23#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
24 QML_NAMED_ELEMENT(SoftwareColorOverlay)
25#endif
26
27public:
28 explicit DQuickColorOverlay(QQuickItem *parent = nullptr);
29
30 QColor color() const;
31 void setColor(const QColor &color);
32
33 QQuickItem *source() const;
34 void setSource(QQuickItem *item);
35
36 void setCached(bool cached);
37 bool cached() const;
38
39Q_SIGNALS:
40 void colorChanged();
41 void sourceChanged();
42 void cachedChanged();
43
44protected:
45 DQuickColorOverlay(DQuickColorOverlayPrivate &dd, QQuickItem *parent = nullptr);
46 QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override;
47};
48
49DQUICK_END_NAMESPACE
50
51#endif // DQUICKCOLOROVERLAY_P_H
Definition dquickcoloroverlay.cpp:12
Definition dquickcoloroverlay_p.h:16
Definition SoftwareColorOverlay.qml:7