IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QGraphicsDropShadowEffect Class

The QGraphicsDropShadowEffect class provides a drop shadow effect.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QGraphicsDropShadowEffect Class

  • Header: QGraphicsDropShadowEffect

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Widgets)

    target_link_libraries(mytarget PRIVATE Qt6::Widgets)

  • qmake: QT += widgets

  • Inherits: QGraphicsEffect

Detailed Description

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.

Image non disponible

See Also

Property Documentation

 

blurRadius : 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.

Access functions:

  • qreal blurRadius() const

  • void setBlurRadius(qreal blurRadius)

Notifier signal:

See Also

See also color(), offset()

color : 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)).

Access functions:

  • color() const

  • void setColor(const &color)

Notifier signal:

See Also

See also offset(), blurRadius()

offset : 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.

Access functions:

  • offset() const

  • void setOffset(const &ofs)

  • void setOffset(qreal dx, qreal dy)

  • void setOffset(qreal d)

Notifier signal:

See Also

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

xOffset : qreal

This property holds the horizontal shadow offset in pixels.

By default, the horizontal shadow offset is 8 pixels.

Access functions:

  • qreal xOffset() const

  • void setXOffset(qreal dx)

Notifier signal:

See Also

See also yOffset(), offset()

yOffset : qreal

This property holds the vertical shadow offset in pixels.

By default, the vertical shadow offset is 8 pixels.

Access functions:

  • qreal yOffset() const

  • void setYOffset(qreal dy)

Notifier signal:

See Also

See also xOffset(), offset()

Member Function Documentation

 

QGraphicsDropShadowEffect::QGraphicsDropShadowEffect(QObject *parent = nullptr)

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

[virtual] QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect()

Destroys the effect.

void QGraphicsDropShadowEffect::blurRadiusChanged(qreal blurRadius)

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

Notifier signal for property blurRadius.

[override virtual] QRectF QGraphicsDropShadowEffect::boundingRectFor(const QRectF &rect) const

void QGraphicsDropShadowEffect::colorChanged(const QColor &color)

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

Notifier signal for property color.

[override virtual protected] void QGraphicsDropShadowEffect::draw(QPainter *painter)

void QGraphicsDropShadowEffect::offsetChanged(const QPointF &offset)

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

Notifier signal for property offset.

Notifier signal for property xOffset.

Notifier signal for property yOffset.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+