Kirigami2

shadowedtexture.h
1 /*
2  * SPDX-FileCopyrightText: 2020 Arjen Hiemstra <[email protected]>
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 {
23  Q_OBJECT
24 
25  /**
26  * This property holds the source item that will get rendered with the
27  * shadow.
28  */
29  Q_PROPERTY(QQuickItem *source READ source WRITE setSource NOTIFY sourceChanged)
30 
31 public:
32  ShadowedTexture(QQuickItem *parent = nullptr);
33  ~ShadowedTexture() override;
34 
35  QQuickItem *source() const;
36  void setSource(QQuickItem *newSource);
37  Q_SIGNAL void sourceChanged();
38 
39 protected:
40  QSGNode *updatePaintNode(QSGNode *node, QQuickItem::UpdatePaintNodeData *data) override;
41 
42 private:
43  QQuickItem *m_source = nullptr;
44  bool m_sourceChanged = false;
45 };
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALQ_SIGNAL
A rectangle with a shadow behind it.
QQuickItem source
This property holds the source item that will get rendered with the shadow.
A rectangle with a shadow, using a QQuickItem as texture.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jan 29 2023 04:11:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.