42 #ifndef QGRAPHICSEFFECT_H 43 #define QGRAPHICSEFFECT_H 45 #include <QtCore/qobject.h> 46 #include <QtCore/qpoint.h> 47 #include <QtCore/qrect.h> 48 #include <QtGui/qcolor.h> 49 #include <QtGui/qbrush.h> 51 #ifndef QT_NO_GRAPHICSEFFECT 75 SourceBoundingRectChanged = 0x4,
76 SourceInvalidated = 0x8
83 PadToEffectiveBoundingRect
89 virtual QRectF boundingRectFor(
const QRectF &sourceRect)
const;
92 bool isEnabled()
const;
95 void setEnabled(
bool enable);
99 void enabledChanged(
bool enabled);
103 virtual void draw(
QPainter *painter) = 0;
104 virtual void sourceChanged(ChangeFlags flags);
105 void updateBoundingRect();
107 bool sourceIsPixmap()
const;
140 qreal strength()
const;
143 void setColor(
const QColor &
c);
144 void setStrength(
qreal strength);
147 void colorChanged(
const QColor &color);
148 void strengthChanged(
qreal strength);
167 PerformanceHint = 0x00,
177 qreal blurRadius()
const;
178 BlurHints blurHints()
const;
181 void setBlurRadius(
qreal blurRadius);
182 void setBlurHints(BlurHints hints);
185 void blurRadiusChanged(
qreal blurRadius);
186 void blurHintsChanged(BlurHints hints);
215 {
return offset().
x(); }
218 {
return offset().
y(); }
220 qreal blurRadius()
const;
224 void setOffset(
const QPointF &ofs);
227 { setOffset(
QPointF(dx, dy)); }
233 { setOffset(
QPointF(dx, yOffset())); }
236 { setOffset(
QPointF(xOffset(), dy)); }
238 void setBlurRadius(
qreal blurRadius);
239 void setColor(
const QColor &color);
242 void offsetChanged(
const QPointF &offset);
243 void blurRadiusChanged(
qreal blurRadius);
244 void colorChanged(
const QColor &color);
264 qreal opacity()
const;
265 QBrush opacityMask()
const;
268 void setOpacity(
qreal opacity);
269 void setOpacityMask(
const QBrush &mask);
272 void opacityChanged(
qreal opacity);
273 void opacityMaskChanged(
const QBrush &mask);
286 #endif //QT_NO_GRAPHICSEFFECT 288 #endif // QGRAPHICSEFFECT_H The QPainter class performs low-level painting on widgets and other paint devices.
The QColor class provides colors based on RGB, HSV or CMYK values.
ChangeFlag
This enum describes what has changed in QGraphicsEffectSource.
#define QT_END_NAMESPACE
This macro expands to.
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
The QPointF class defines a point in the plane using floating point precision.
void setXOffset(qreal dx)
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
The QGraphicsEffectSource class represents the source on which a QGraphicsEffect is installed on...
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
The QGraphicsDropShadowEffect class provides a drop shadow effect.
The QObject class is the base class of all Qt objects.
The QGraphicsBlurEffect class provides a blur effect.
qreal x() const
Returns the x-coordinate of this point.
static const QRectF boundingRect(const QPointF *points, int pointCount)
QColor color
the color of the drop shadow.
#define QT_BEGIN_NAMESPACE
This macro expands to.
qreal strength
the strength of the effect.
The QRectF class defines a rectangle in the plane using floating point precision. ...
void setOffset(qreal dx, qreal dy)
The QGraphicsColorizeEffect class provides a colorize effect.
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
qreal xOffset
the horizontal shadow offset in pixels.
The QStyleOption class stores the parameters used by QStyle functions.
QColor color
the color of the effect.
PixmapPadMode
This enum describes how the pixmap returned from sourcePixmap should be padded.
QPointF offset
the shadow offset in pixels.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
The QGraphicsOpacityEffect class provides an opacity effect.
qreal blurRadius
the blur radius in pixels of the drop shadow.
qreal yOffset
the vertical shadow offset in pixels.
The QPoint class defines a point in the plane using integer precision.
virtual QRectF boundingRectFor(const QRectF &sourceRect) const
Returns the effective bounding rectangle for this effect, given the provided rect in the device coord...
BlurHint
This enum describes the possible hints that can be used to control how blur effects are applied...
qreal y() const
Returns the y-coordinate of this point.
The QPixmap class is an off-screen image representation that can be used as a paint device...
#define Q_DECLARE_PRIVATE(Class)
void setYOffset(qreal dy)
qreal opacity
the opacity of the effect.
QBrush opacityMask
the opacity mask of the effect.
virtual void draw(QPainter *painter)=0
This pure virtual function draws the effect and is called whenever the source needs to be drawn...
The QGraphicsEffect class is the base class for all graphics effects.