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  · 

QGraphicsOpacityEffect Class

The QGraphicsOpacityEffect class provides an opacity effect. More...

 #include <QGraphicsOpacityEffect>

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

QGraphicsEffect(QObject * parent = 0)
QGraphicsOpacityEffect(QObject * parent = 0)
virtual ~QGraphicsEffect()
~QGraphicsOpacityEffect()
QRectF boundingRect() const
virtual QRectF boundingRectFor(const QRectF & rect) const
bool isEnabled() const
qreal opacity() const
QBrush opacityMask() const
  • 31 public functions inherited from QObject

Public Slots

void setEnabled(bool enable)
void setOpacity(qreal opacity)
void setOpacityMask(const QBrush & mask)
void update()
  • 1 public slot inherited from QObject

Signals

void enabledChanged(bool enabled)
void opacityChanged(qreal opacity)
void opacityMaskChanged(const QBrush & mask)

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 QGraphicsOpacityEffect class provides an opacity effect.

An opacity effect renders the source with an opacity. This effect is useful for making the source semi-transparent, similar to a fade-in/fade-out sequence. The opacity can be modified using the setOpacity() function.

By default, the opacity is 0.7.

See also QGraphicsDropShadowEffect, QGraphicsBlurEffect, and QGraphicsColorizeEffect.

Property Documentation

opacity : qreal

This property holds the opacity of the effect.

The value should be in the range of 0.0 to 1.0, where 0.0 is fully transparent and 1.0 is fully opaque.

By default, the opacity is 0.7.

Access functions:

qreal opacity() const
void setOpacity(qreal opacity)

Notifier signal:

void opacityChanged(qreal opacity)

See also setOpacityMask().

opacityMask : QBrush

This property holds the opacity mask of the effect.

An opacity mask allows you apply opacity to portions of an element.

For example:

 ...
 QLinearGradient alphaGradient(rect.topLeft(), rect.bottomLeft());
 alphaGradient.setColorAt(0.0, Qt::transparent);
 alphaGradient.setColorAt(0.5, Qt::black);
 alphaGradient.setColorAt(1.0, Qt::transparent);
 QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect;
 effect->setOpacityMask(alphaGradient);
 ...

There is no opacity mask by default.

Access functions:

QBrush opacityMask() const
void setOpacityMask(const QBrush & mask)

Notifier signal:

void opacityMaskChanged(const QBrush & mask)

See also setOpacity().

Member Function Documentation

QGraphicsOpacityEffect::QGraphicsOpacityEffect(QObject * parent = 0)

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

QGraphicsOpacityEffect::~QGraphicsOpacityEffect()

Destroys the effect.

void QGraphicsOpacityEffect::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