DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickinwindowblur_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 DQUICKINWINDOWBLUR_P_H
6#define DQUICKINWINDOWBLUR_P_H
7
8#include <dtkdeclarative_global.h>
9
10#include <QQuickItem>
11
12QT_BEGIN_NAMESPACE
13class QSGPlainTexture;
14#ifndef QT_NO_OPENGL
15class QOpenGLFramebufferObject;
16#endif
17QT_END_NAMESPACE
18
19DQUICK_BEGIN_NAMESPACE
20
21class DQuickInWindowBlendBlurPrivate;
22class InWindowBlurTextureProvider;
23class DSGBlurNode;
24class DQuickInWindowBlur : public QQuickItem
25{
26 Q_OBJECT
27 Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
28 Q_PROPERTY(bool offscreen READ offscreen WRITE setOffscreen NOTIFY offscreenChanged)
29#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
30 QML_NAMED_ELEMENT(InWindowBlurImpl)
31#endif
32
33public:
34 explicit DQuickInWindowBlur(QQuickItem *parent = nullptr);
35 ~DQuickInWindowBlur() override;
36
37 qreal radius() const;
38 void setRadius(qreal newRadius);
39
40 bool offscreen() const;
41 void setOffscreen(bool newOffscreen);
42
43 bool isTextureProvider() const override { return true; }
44 QSGTextureProvider *textureProvider() const override;
45
46Q_SIGNALS:
47 void radiusChanged();
48 void offscreenChanged();
49
50protected:
51 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
52 void itemChange(ItemChange, const ItemChangeData &) override;
53 void releaseResources() override;
54
55private Q_SLOTS:
56 void invalidateSceneGraph();
57
58private:
59 qreal m_radius = 20;
60 bool m_offscreen = false;
61 mutable InWindowBlurTextureProvider *m_tp = nullptr;
62 friend void onRender(DSGBlurNode *, void *);
63};
64
65DQUICK_END_NAMESPACE
66
67#endif // DQUICKINWINDOWBLUR_P_H
Definition dquickinwindowblur_p.h:25
Definition dblurimagenode_p.h:31
Definition dquickinwindowblur.cpp:22