DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickrectangle_p_p.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKRECTANGLE_P_P_H
6#define DQUICKRECTANGLE_P_P_H
7
8#include "dquickrectangle_p.h"
9#include "dquickitemviewport_p.h"
10
11#include <private/qquickitem_p.h>
12
13DQUICK_BEGIN_NAMESPACE
14
15class Q_DECL_HIDDEN DQuickRectanglePrivate : public QQuickItemPrivate
16{
17 Q_DECLARE_PUBLIC(DQuickRectangle)
18
19public:
21 : QQuickItemPrivate ()
22 , radius(0.0)
23 , color(Qt::white)
24 {
25
26 }
27
28 inline QSGTexture *textureForRadiusMask()
29 {
30 if (!maskTexture && radius > 0) {
31 QQuickItemPrivate *d = QQuickItemPrivate::get(q_func());
32 maskTexture = MaskTextureCache::instance()->getTexture(d->sceneGraphRenderContext(),
33 radius * d->window->effectiveDevicePixelRatio(), true);
34 }
35 return maskTexture->texture;
36 }
37
38 qreal radius;
39 QColor color;
40 DQuickRectangle::Corners corners;
41 MaskTextureCache::TextureData maskTexture;
42};
43
44DQUICK_END_NAMESPACE
45
46#endif // DQUICKRECTANGLE_P_P_H
Definition dquickrectangle_p_p.h:16
Definition dquickrectangle_p.h:17