Fluid
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
Fluid::Elevation Class Reference

A QQuickItem that renders elevation-based shadow effects. More...

#include <elevation.h>

Inheritance diagram for Fluid::Elevation:
Inheritance graph
[legend]
Collaboration diagram for Fluid::Elevation:
Collaboration graph
[legend]

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
 

Detailed Description

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:

Note
This class uses Qt's scene graph API for efficient rendering.
The shadow effect follows Material Design principles with ambient and spot lighting.

Constructor & Destructor Documentation

◆ Elevation()

Elevation::Elevation ( QQuickItem *  parentItem = nullptr)

Constructs an Elevation item with an optional parent.

Parameters
parentItemThe parent QQuickItem, if any.

◆ ~Elevation()

Elevation::~Elevation ( )
override

Destructor for the Elevation item.

Member Function Documentation

◆ bottomLeftRadius()

qreal Elevation::bottomLeftRadius ( ) const

◆ bottomLeftRadiusChanged

void Fluid::Elevation::bottomLeftRadiusChanged ( qreal  bottomLeftRadius)
signal

◆ bottomRightRadius()

qreal Elevation::bottomRightRadius ( ) const

◆ bottomRightRadiusChanged

void Fluid::Elevation::bottomRightRadiusChanged ( qreal  bottomRightRadius)
signal

◆ color()

QColor Elevation::color ( ) const

Returns the current shadow color.

Returns
QColor representing the shadow color.

◆ colorChanged

void Fluid::Elevation::colorChanged ( QColor  color)
signal

◆ componentComplete()

void Elevation::componentComplete ( )
override

Called when the component is complete.

◆ elevation()

qreal Elevation::elevation ( ) const

Returns the current elevation level.

Returns
Elevation level as a double.

◆ elevationChanged

void Fluid::Elevation::elevationChanged ( qreal  elevation)
signal

◆ itemChange()

void Elevation::itemChange ( QQuickItem::ItemChange  change,
const QQuickItem::ItemChangeData &  value 
)
overrideprotected

Handles item changes.

Parameters
changeThe type of change.
valueAdditional data related to the change.

◆ radius()

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.

Returns
Radius as a qreal.

◆ radiusChanged

void Fluid::Elevation::radiusChanged ( qreal  radius)
signal

◆ setBottomLeftRadius()

void Elevation::setBottomLeftRadius ( qreal  newBottomLeftRadius)

◆ setBottomRightRadius()

void Elevation::setBottomRightRadius ( qreal  newBottomRightRadius)

◆ setColor()

void Elevation::setColor ( const QColor &  newColor)

Sets the shadow color.

Parameters
newColorNew QColor for the shadow.

◆ setElevation()

void Elevation::setElevation ( qreal  l)

Sets the elevation level.

Parameters
lNew elevation level.

◆ setRadius()

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.

Parameters
newRadiusNew radius value.

◆ setTopLeftRadius()

void Elevation::setTopLeftRadius ( qreal  newTopLeftRadius)

◆ setTopRightRadius()

void Elevation::setTopRightRadius ( qreal  newTopRightRadius)

◆ topLeftRadius()

qreal Elevation::topLeftRadius ( ) const

◆ topLeftRadiusChanged

void Fluid::Elevation::topLeftRadiusChanged ( qreal  topLeftRadius)
signal

◆ topRightRadius()

qreal Elevation::topRightRadius ( ) const

◆ topRightRadiusChanged

void Fluid::Elevation::topRightRadiusChanged ( qreal  topRightRadius)
signal

◆ updatePaintNode()

QSGNode * Elevation::updatePaintNode ( QSGNode *  node,
QQuickItem::UpdatePaintNodeData *  data 
)
overrideprotected

Updates the paint node for rendering.

Parameters
nodeThe existing QSGNode, if any.
dataAdditional data for updating the paint node.
Returns
Updated QSGNode for rendering.

Property Documentation

◆ bottomLeftRadius

qreal Fluid::Elevation::bottomLeftRadius
readwrite

◆ bottomRightRadius

qreal Fluid::Elevation::bottomRightRadius
readwrite

◆ color

QColor Fluid::Elevation::color
readwrite

◆ elevation

qreal Fluid::Elevation::elevation
readwrite

◆ radius

qreal Fluid::Elevation::radius
readwrite

◆ topLeftRadius

qreal Fluid::Elevation::topLeftRadius
readwrite

◆ topRightRadius

qreal Fluid::Elevation::topRightRadius
readwrite

The documentation for this class was generated from the following files: