Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QGraphicsDropShadowEffect Class

The QGraphicsDropShadowEffect class provides a drop shadow effect. More...

 #include <QGraphicsDropShadowEffect>

Inherits: QGraphicsEffect.

This class was introduced in Qt 4.6.

Public Types

enum ChangeFlag { SourceAttached, SourceDetached, SourceBoundingRectChanged, SourceInvalidated }
flags ChangeFlags
enum PixmapPadMode { NoPad, PadToTransparentBorder, PadToEffectiveBoundingRect }

Properties

  • 1 property inherited from QObject

Public Functions

QGraphicsDropShadowEffect(QObject * parent = 0)
QGraphicsEffect(QObject * parent = 0)
~QGraphicsDropShadowEffect()
virtual ~QGraphicsEffect()
qreal blurRadius() const
QRectF boundingRect() const
virtual QRectF boundingRectFor(const QRectF & rect) const
QColor color() const
bool isEnabled() const
QPointF offset() const
qreal xOffset() const
qreal yOffset() const

Reimplemented Public Functions

virtual QRectF boundingRectFor(const QRectF & rect) const
  • 31 public functions inherited from QObject

Public Slots

void setBlurRadius(qreal blurRadius)
void setColor(const QColor & color)
void setEnabled(bool enable)
void setOffset(const QPointF & ofs)
void setOffset(qreal dx, qreal dy)
void setOffset(qreal d)
void setXOffset(qreal dx)
void setYOffset(qreal dy)
void update()
  • 1 public slot inherited from QObject

Signals

void blurRadiusChanged(qreal blurRadius)
void colorChanged(const QColor & color)
void enabledChanged(bool enabled)
void offsetChanged(const QPointF & offset)

Protected Functions

virtual void draw(QPainter * painter) = 0
void drawSource(QPainter * painter)
QRectF sourceBoundingRect(Qt::CoordinateSystem system = Qt::LogicalCoordinates) const
virtual void sourceChanged(ChangeFlags flags)
bool sourceIsPixmap() const
QPixmap sourcePixmap(Qt::CoordinateSystem system = Qt::LogicalCoordinates, QPoint * offset = 0, PixmapPadMode mode = PadToEffectiveBoundingRect) const
void updateBoundingRect()

Reimplemented Protected Functions

virtual void draw(QPainter * painter)
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 11 static public members inherited from QObject

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.

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:

void blurRadiusChanged(qreal blurRadius)

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

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:

QColor color() const
void setColor(const QColor & color)

Notifier signal:

void colorChanged(const QColor & color)

See also offset() and 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:

QPointF offset() const
void setOffset(const QPointF & ofs)
void setOffset(qreal dx, qreal dy)
void setOffset(qreal d)

Notifier signal:

void offsetChanged(const QPointF & offset)

See also xOffset(), yOffset(), blurRadius(), and 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:

void offsetChanged(const QPointF & offset)

See also yOffset() and 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:

void offsetChanged(const QPointF & offset)

See also xOffset() and offset().

Member Function Documentation

QGraphicsDropShadowEffect::QGraphicsDropShadowEffect(QObject * parent = 0)

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

QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect()

Destroys the effect.

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

Reimplemented from QGraphicsEffect::boundingRectFor().

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

Reimplemented from QGraphicsEffect::draw().

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web