Fluid
Loading...
Searching...
No Matches
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]

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.
 
Q_SIGNAL void elevationChanged (qreal elevation)
 
const CornersGroupcorners () const
 Returns the corners group.
 
void setCorners (const CornersGroup &)
 Sets the corners group.
 
Q_SIGNAL void cornersChanged (CornersGroup)
 
qreal radius () const
 Returns the current radius.
 
void setRadius (qreal newRadius)
 Sets the radius for all corners.
 
Q_SIGNAL void radiusChanged (qreal radius)
 
QColor color () const
 Returns the current shadow color.
 
void setColor (const QColor &newColor)
 Sets the shadow color.
 
Q_SIGNAL void colorChanged (QColor 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
 
QColor color
 
CornersGroup corners
 

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.
See also
CornersGroup

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

◆ color()

QColor Elevation::color ( ) const

Returns the current shadow color.

Returns
QColor representing the shadow color.

◆ colorChanged()

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

◆ componentComplete()

void Elevation::componentComplete ( )
override

Called when the component is complete.

◆ corners()

const CornersGroup & Elevation::corners ( ) const

Returns the corners group.

Returns
CornersGroup representing the corner radii.

◆ cornersChanged()

Q_SIGNAL void Fluid::Elevation::cornersChanged ( CornersGroup  )

◆ elevation()

qreal Elevation::elevation ( ) const

Returns the current elevation level.

Returns
Elevation level as a double.

◆ elevationChanged()

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

◆ 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.

Returns
Radius as a qreal.

◆ radiusChanged()

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

◆ setColor()

void Elevation::setColor ( const QColor &  newColor)

Sets the shadow color.

Parameters
newColorNew QColor for the shadow.

◆ setCorners()

void Elevation::setCorners ( const CornersGroup c)

Sets the corners group.

Parameters
cNew CornersGroup representing the corner radii.

◆ 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.

Parameters
newRadiusNew radius value.

◆ 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

◆ color

QColor Fluid::Elevation::color
readwrite

◆ corners

CornersGroup Fluid::Elevation::corners
readwrite

◆ elevation

qreal Fluid::Elevation::elevation
readwrite

◆ radius

qreal Fluid::Elevation::radius
readwrite

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