DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickbackdropblitter_p.h
1// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#pragma once
6
7#include <dtkdeclarative_global.h>
8#include <DObject>
9#include <QQuickItem>
10
11DQUICK_BEGIN_NAMESPACE
12
13class DQuickBackdropBlitterPrivate;
14class Q_DECL_EXPORT DQuickBackdropBlitter : public QQuickItem, public DCORE_NAMESPACE::DObject
15{
16 Q_OBJECT
17 D_DECLARE_PRIVATE(DQuickBackdropBlitter)
18 Q_PRIVATE_PROPERTY(DQuickBackdropBlitter::d_func(), QQmlListProperty<QObject> data READ data DESIGNABLE false)
19 Q_PROPERTY(QQuickItem* content READ content CONSTANT)
20 Q_PROPERTY(bool offscreen READ offscreen WRITE setOffscreen NOTIFY offscreenChanged FINAL)
21 Q_PROPERTY(bool blitterEnabled READ blitterEnabled WRITE setBlitterEnabled NOTIFY blitterEnabledChanged FINAL)
22 QML_NAMED_ELEMENT(BackdropBlitter)
23
24public:
25 explicit DQuickBackdropBlitter(QQuickItem *parent = nullptr);
27
28 QQuickItem *content() const;
29
30 bool offscreen() const;
31 void setOffscreen(bool newOffscreen);
32
33 bool blitterEnabled() const;
34 void setBlitterEnabled(bool newBlitterEnabled);
35
36Q_SIGNALS:
37 void offscreenChanged();
38 void blitterEnabledChanged();
39
40private Q_SLOTS:
41 void invalidateSceneGraph();
42
43private:
44 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
45 void itemChange(ItemChange, const ItemChangeData &) override;
46 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
47 void releaseResources() override;
48};
49
50DQUICK_END_NAMESPACE
用于获取窗口中已渲染的背景结果,可以将此结果用于特效加工类的控件,如用于实现高斯模糊效果。
Definition dquickbackdropblitter_p.h:15