QGraphicsDropShadowEffect Class Reference

The QGraphicsDropShadowEffect class provides a drop shadow effect.

  1. #include <QGraphicsDropShadowEffect>

Inherits: QGraphicsEffect.

This class was introduced in Qt 4.6.

Detailed Description

The QGraphicsDropShadowEffect class provides a drop shadow effect.

A drop shadow effect renders the source with a drop shadow. The color of the drop shadow can be modified using the setColor() function. The drop shadow offset can be modified using the setOffset() function and the blur radius of the drop shadow can be changed with the setBlurRadius() function.

By default, the drop shadow is a semi-transparent dark gray (QColor(63, 63, 63, 180)) shadow, blurred with a radius of 1 at an offset of 8 pixels towards the lower right. The drop shadow offset is specified in device coordinates.

See also QGraphicsBlurEffect, QGraphicsColorizeEffect, and QGraphicsOpacityEffect.

Properties

Toggle detailsblurRadiusblurRadius : qreal

This property holds the blur radius in pixels of the drop shadow.

Using a smaller radius results in a sharper shadow, whereas using a bigger radius results in a more blurred shadow.

By default, the blur radius is 1 pixel.

See also color(), offset(), and ..

Access functions:

Look up this member in the source code.

Toggle detailscolorcolor : QColor

This property holds the color of the drop shadow.

By default, the drop color is a semi-transparent dark gray (QColor(63, 63, 63, 180)).

See also offset() and blurRadius().

Access functions:

Look up this member in the source code.

Toggle detailsoffsetoffset : QPointF

This property holds the shadow offset in pixels.

By default, the offset is 8 pixels towards the lower right.

The offset is given in device coordinates, which means it is unaffected by scale.

See also xOffset(), yOffset(), blurRadius(), and color().

Access functions:

Look up this member in the source code.

Toggle detailsxOffsetxOffset : qreal

This property holds the horizontal shadow offset in pixels.

By default, the horizontal shadow offset is 8 pixels.

See also yOffset() and offset().

Access functions:

Look up this member in the source code.

Toggle detailsyOffsetyOffset : qreal

This property holds the vertical shadow offset in pixels.

By default, the vertical shadow offset is 8 pixels.

See also xOffset() and offset().

Access functions:

Look up this member in the source code.

    Public Functions

    Toggle details QGraphicsDropShadowEffect

    QGraphicsDropShadowEffectQGraphicsDropShadowEffect ( QObject *parent=0 ) ( QObject *parent=0 )

    Constructs a new QGraphicsDropShadowEffect instance. The parent parameter is passed to QGraphicsEffect's constructor.

    Look up this member in the source code.

    Toggle details QGraphicsDropShadowEffect

    ~QGraphicsDropShadowEffect~QGraphicsDropShadowEffect () ()

    Destroys the effect.

    Look up this member in the source code.

    Toggle details QRectF QGraphicsDropShadowEffect

    boundingRectForboundingRectFor ( const QRectF &rect ) ( const QRectF &rect )const [virtual]

    Reimplemented from QGraphicsEffect::boundingRectFor().

    Look up this member in the source code.

    Toggle details void QGraphicsDropShadowEffect

    drawdraw ( QPainter *painter ) ( QPainter *painter ) [virtual protected]

    Reimplemented from QGraphicsEffect::draw().

    Look up this member in the source code.

      Signals

      Toggle details void QGraphicsDropShadowEffect

      blurRadiusChangedblurRadiusChanged ( qreal blurRadius ) ( qreal blurRadius ) [signal]

      This signal is emitted whenever the effect's blur radius changes. The blurRadius parameter holds the effect's new blur radius.

      Look up this member in the source code.

      Toggle details void QGraphicsDropShadowEffect

      colorChangedcolorChanged ( const QColor &color ) ( const QColor &color ) [signal]

      This signal is emitted whenever the effect's color changes. The color parameter holds the effect's new color.

      Look up this member in the source code.

      Toggle details void QGraphicsDropShadowEffect

      offsetChangedoffsetChanged ( const QPointF &offset ) ( const QPointF &offset ) [signal]

      This signal is emitted whenever the effect's shadow offset changes. The offset parameter holds the effect's new shadow offset.

      Look up this member in the source code.

        Notes provided by the Qt Community

        No notes