- Qt 6.12
- Qt Canvas Painter
- QML Types
- boxshadow2d
- Qt Canvas Painter | Commercial or GPLv3

# boxshadow2d QML Value Type

Provides boxshadow2d type matching to QCanvasBoxShadow. More...

Import Statement: | `import QtCanvas2D`
Since: | Qt 6.12
Status: | Technology preview

This type is in technology preview and is subject to change.

## Methods

- real blur()
- real bottomLeftRadius()
- real bottomRightRadius()
- rect boundingRect()
- color color()
- real radius()
- rect rect()
- void setBlur(real blur)
- void setBottomLeftRadius(real radius)
- void setBottomRightRadius(real radius)
- void setColor(color shadowColor)
- void setRadius(real radius)
- void setRect(real x, real y, real width, real height)
- void setRect(rect shadowRect)
- void setSpread(real spread)
- void setTopLeftRadius(real radius)
- void setTopRightRadius(real radius)
- real spread()
- real topLeftRadius()
- real topRightRadius()

## Detailed Description

This value type is provided by the QtCanvas2D import.

See also QCanvasBoxShadow.

## Method Documentation

### real blur()

Returns the blur of shadow box.

See also setBlur().

### real bottomLeftRadius()

Returns the bottom-left radius of shadow box. When this is `-1`, painting of the shadow will use the value of radius() for this corner. The default value is `-1`.

See also setBottomLeftRadius().

### real bottomRightRadius()

Returns the bottom-right radius of shadow box. When this is `-1`, painting of the shadow will use the value of radius() for this corner. The default value is `-1`.

See also setBottomRightRadius().

### rect boundingRect()

Returns the area covered by the shadow. This takes into account the shadow rect(), blur() and spread(). If you don't want to use QCanvasPainter::drawBoxShadow() helper method, this can be used to for e.g. adding correctly sized QCanvasPainter::rect() into the path.

See also setRect(), setBlur(), and setSpread().

### color color()

Returns the color of shadow box.

See also setColor().

### real radius()

Returns the radius of shadow box.

See also setRadius().

### rect rect()

Returns the rect area of shadow box.

See also setRect().

### void setBlur(real blur)

Sets the shadow blur to blur in pixels. The default value is `0.0` meaning no blur.

See also blur().

### void setBottomLeftRadius(real radius)

Sets the bottom-left corner radius to radius. The default value is `-1` which means that individual radius has not been set for this corner, and common radius() is used instead.

See also bottomLeftRadius().

### void setBottomRightRadius(real radius)

Sets the bottom-right corner radius to radius. The default value is `-1` which means that individual radius has not been set for this corner, and common radius() is used instead.

See also bottomRightRadius().

### void setColor(color shadowColor)

Sets the shadow color to shadowColor. The default value is black with full opacity.

See also color().

### void setRadius(real radius)

Sets the shadow corner radius to radius in pixels. The default value is `0.0` meaning no radius.

See also radius().

### void setRect(real x, real y, real width, real height)

Sets the rect area of shadow box to (x, y, width, height).

See also rect().

### void setRect(rect shadowRect)

Sets the rect area of shadow box to shadowRect.

This is an overloaded function.

### void setSpread(real spread)

Sets the shadow spread to spread in pixels. The default value is `0.0` meaning no spread.

See also spread().

### void setTopLeftRadius(real radius)

Sets the top-left corner radius to radius. The default value is `-1` which means that individual radius has not been set for this corner, and common radius() is used instead.

See also topLeftRadius().

### void setTopRightRadius(real radius)

Sets the top-right corner radius to radius. The default value is `-1` which means that individual radius has not been set for this corner, and common radius() is used instead.

See also topRightRadius().

### real spread()

Returns the spread of shadow box.

See also setSpread().

### real topLeftRadius()

Returns the top-left radius of shadow box. When this is `-1`, painting of the shadow will use the value of radius() for this corner. The default value is `-1`.

See also setTopLeftRadius().

### real topRightRadius()

Returns the top-right radius of shadow box. When this is `-1`, painting of the shadow will use the value of radius() for this corner. The default value is `-1`.

See also setTopRightRadius().