|
Fluid 1.3.0
Material Design for QtQuick and Qml
|
A QQuickItem that renders elevation-based shadow effects. More...
#include <elevation.h>
Signals | |
| void | elevationChanged (qreal elevation) |
| void | radiusChanged (qreal radius) |
| void | topLeftRadiusChanged (qreal topLeftRadius) |
| void | topRightRadiusChanged (qreal topRightRadius) |
| void | bottomLeftRadiusChanged (qreal bottomLeftRadius) |
| void | bottomRightRadiusChanged (qreal bottomRightRadius) |
| void | colorChanged (QColor color) |
Public Member Functions | |
| Elevation (QQuickItem *parent=nullptr) | |
| Constructs an Elevation item with an optional parent. | |
| ~Elevation () override | |
| Destructor for the Elevation item. | |
| qreal | elevation () const |
| Returns the current elevation level. | |
| void | setElevation (qreal elevation) |
| Sets the elevation level. | |
| qreal | radius () const |
| Returns the current radius. | |
| void | setRadius (qreal newRadius) |
| Sets the radius for all corners. | |
| qreal | topLeftRadius () const |
| void | setTopLeftRadius (qreal newTopLeftRadius) |
| qreal | topRightRadius () const |
| void | setTopRightRadius (qreal newTopRightRadius) |
| qreal | bottomLeftRadius () const |
| void | setBottomLeftRadius (qreal newBottomLeftRadius) |
| qreal | bottomRightRadius () const |
| void | setBottomRightRadius (qreal newBottomRightRadius) |
| QColor | color () const |
| Returns the current shadow color. | |
| void | setColor (const QColor &newColor) |
| Sets the shadow color. | |
| void | componentComplete () override |
| Called when the component is complete. | |
Protected Member Functions | |
| void | itemChange (QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value) override |
| Handles item changes. | |
| QSGNode * | updatePaintNode (QSGNode *node, QQuickItem::UpdatePaintNodeData *data) override |
| Updates the paint node for rendering. | |
Properties | |
| qreal | elevation |
| qreal | radius |
| qreal | topLeftRadius |
| qreal | topRightRadius |
| qreal | bottomLeftRadius |
| qreal | bottomRightRadius |
| QColor | color |
A QQuickItem that renders elevation-based shadow effects.
The Elevation class provides a visual shadow effect that simulates material design elevation. It renders shadows beneath the item based on the specified elevation level, corner radii, and color. The shadow is rendered using a custom scene graph node (ElevationNode) that handles the geometry and material for the shadow effect.
The class supports:
Definition at line 16 of file elevation.h.
| Elevation::Elevation | ( | QQuickItem * | parentItem = nullptr | ) |
Constructs an Elevation item with an optional parent.
| parentItem | The parent QQuickItem, if any. |
Definition at line 108 of file elevation.cpp.
|
override |
Destructor for the Elevation item.
Definition at line 123 of file elevation.cpp.
| qreal Elevation::bottomLeftRadius | ( | ) | const |
Definition at line 236 of file elevation.cpp.
|
signal |
| qreal Elevation::bottomRightRadius | ( | ) | const |
Definition at line 253 of file elevation.cpp.
|
signal |
| QColor Elevation::color | ( | ) | const |
Returns the current shadow color.
Definition at line 274 of file elevation.cpp.
|
signal |
|
override |
Called when the component is complete.
Definition at line 296 of file elevation.cpp.
| qreal Elevation::elevation | ( | ) | const |
Returns the current elevation level.
Definition at line 131 of file elevation.cpp.
|
signal |
|
overrideprotected |
Handles item changes.
| change | The type of change. |
| value | Additional data related to the change. |
Definition at line 306 of file elevation.cpp.
| qreal Elevation::radius | ( | ) | const |
Returns the current radius.
If any individual corner radius has been explicitly set, returns the maximum of all four corner radii. Otherwise returns the uniform radius value.
Definition at line 156 of file elevation.cpp.
|
signal |
| void Elevation::setBottomLeftRadius | ( | qreal | newBottomLeftRadius | ) |
Definition at line 241 of file elevation.cpp.
| void Elevation::setBottomRightRadius | ( | qreal | newBottomRightRadius | ) |
Definition at line 258 of file elevation.cpp.
| void Elevation::setColor | ( | const QColor & | newColor | ) |
Sets the shadow color.
| newColor | New QColor for the shadow. |
Definition at line 283 of file elevation.cpp.
| void Elevation::setElevation | ( | qreal | l | ) |
Sets the elevation level.
| l | New elevation level. |
Definition at line 140 of file elevation.cpp.
| void Elevation::setRadius | ( | qreal | newRadius | ) |
Sets the radius for all corners.
Clears any individually overridden corner radii, so all four corners will use this value. Individual radii set afterwards will override it.
| newRadius | New radius value. |
Definition at line 174 of file elevation.cpp.
| void Elevation::setTopLeftRadius | ( | qreal | newTopLeftRadius | ) |
Definition at line 207 of file elevation.cpp.
| void Elevation::setTopRightRadius | ( | qreal | newTopRightRadius | ) |
Definition at line 224 of file elevation.cpp.
| qreal Elevation::topLeftRadius | ( | ) | const |
Definition at line 202 of file elevation.cpp.
|
signal |
| qreal Elevation::topRightRadius | ( | ) | const |
Definition at line 219 of file elevation.cpp.
|
signal |
|
overrideprotected |
Updates the paint node for rendering.
| node | The existing QSGNode, if any. |
| data | Additional data for updating the paint node. |
Definition at line 321 of file elevation.cpp.
|
readwrite |
Definition at line 26 of file elevation.h.
|
readwrite |
Definition at line 28 of file elevation.h.
|
readwrite |
Definition at line 30 of file elevation.h.
|
readwrite |
Definition at line 20 of file elevation.h.
|
readwrite |
Definition at line 21 of file elevation.h.
|
readwrite |
Definition at line 22 of file elevation.h.
|
readwrite |
Definition at line 24 of file elevation.h.