DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickbehindwindowblur_p.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKBEHINDWINDOWBLUR_P_H
6#define DQUICKBEHINDWINDOWBLUR_P_H
7
8#include <DPlatformHandle>
9
10#include <dtkdeclarative_global.h>
11
12#include <QQuickItem>
13
14DQUICK_BEGIN_NAMESPACE
15
16class DQuickWindowAttached;
17class DQuickBehindWindowBlurPrivate;
18class DQuickBehindWindowBlur : public QQuickItem
19{
20 Q_OBJECT
21 Q_PROPERTY(qreal cornerRadius READ cornerRadius WRITE setCornerRadius NOTIFY cornerRadiusChanged)
22 Q_PROPERTY(QColor blendColor READ blendColor WRITE setBlendColor NOTIFY blendColorChanged)
23 Q_PROPERTY(bool valid READ valid NOTIFY validChanged)
24#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
25 QML_NAMED_ELEMENT(BehindWindowBlur)
26#endif
27
28public:
29 explicit DQuickBehindWindowBlur(QQuickItem *parent = nullptr);
30 ~DQuickBehindWindowBlur() override;
31
32 qreal cornerRadius() const;
33 void setCornerRadius(qreal newRadius);
34
35 const QColor &blendColor() const;
36 void setBlendColor(const QColor &newBlendColor);
37
38 bool valid() const;
39
40Q_SIGNALS:
41 void cornerRadiusChanged();
42 void blendColorChanged();
43 void validChanged();
44
45protected:
46 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
47 void itemChange(ItemChange change, const ItemChangeData &value);
48 void componentComplete() override;
49
50private:
51 void setWindowAttached(DQuickWindowAttached *wa);
52
53private:
54 Q_DISABLE_COPY(DQuickBehindWindowBlur)
55 Q_DECLARE_PRIVATE(DQuickBehindWindowBlur)
56 Q_PRIVATE_SLOT(d_func(), void _q_updateBlurArea())
57 friend class DQuickWindowAttachedPrivate;
58 friend class DSGBlendNode;
59};
60
61DQUICK_END_NAMESPACE
62
63#endif // DQUICKBEHINDWINDOWBLUR_P_H
提供一个能使窗口背景模糊的控件.
Definition dquickbehindwindowblur_p.h:19
Definition dquickwindow_p.h:29
Definition dquickwindow.h:49
Definition dquickbehindwindowblur.cpp:19