Kirigami2

shadowedtexture.h
1/*
2 * SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#pragma once
8
9#include "shadowedrectangle.h"
10
11/**
12 * A rectangle with a shadow, using a QQuickItem as texture.
13 *
14 * This item will render a source item, with a shadow below it. The rendering is done
15 * using distance fields, which provide greatly improved performance. The shadow is
16 * rendered outside of the item's bounds, so the item's width and height are the
17 * rectangle's width and height.
18 *
19 * @since 5.69 / 2.12
20 */
22{
24 QML_ELEMENT
25
26 /**
27 * This property holds the source item that will get rendered with the
28 * shadow.
29 */
30 Q_PROPERTY(QQuickItem *source READ source WRITE setSource NOTIFY sourceChanged FINAL)
31
32public:
34 ~ShadowedTexture() override;
35
36 QQuickItem *source() const;
37 void setSource(QQuickItem *newSource);
38 Q_SIGNAL void sourceChanged();
39
40protected:
41 QSGNode *updatePaintNode(QSGNode *node, QQuickItem::UpdatePaintNodeData *data) override;
42
43private:
44 QQuickItem *m_source = nullptr;
45 bool m_sourceChanged = false;
46};
A rectangle with a shadow, using a QQuickItem as texture.
QML_ELEMENTQQuickItem * source
This property holds the source item that will get rendered with the shadow.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALQ_SIGNAL
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:46 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.