70#include "private/qgraphicsitem_p.h"
72#include <QtWidgets/qgraphicsitem.h>
74#include <QtGui/qimage.h>
75#include <QtGui/qpainter.h>
76#include <QtGui/qpaintengine.h>
77#include <QtCore/qrect.h>
78#include <QtCore/qdebug.h>
79#include <private/qdrawhelper_p.h>
123 return d_func()->boundingRect(system);
139 return d->source->boundingRect(system);
151 return d_func()->graphicsItem();
162 return d_func()->widget();
173 return d_func()->styleOption();
244 return d_func()->isPixmap();
285 return pixmapItem->
pixmap();
289 !
static_cast<const QGraphicsItemEffectSourcePrivate *
>(d_func())->
info)) {
290 qWarning(
"QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context");
295 if (
item &&
d->m_cachedSystem == system &&
d->m_cachedMode ==
mode)
299 pm =
d->pixmap(system, &
d->m_cachedOffset,
mode);
300 d->m_cachedSystem = system;
301 d->m_cachedMode =
mode;
303 d->invalidateCache();
382 d->setGraphicsEffectSource(
nullptr);
441 d->source->d_func()->effectBoundingRectChanged();
442 d->source->d_func()->invalidateCache();
497 d->source->d_func()->effectBoundingRectChanged();
598 return d->filter->color();
604 if (
d->filter->color() ==
color)
607 d->filter->setColor(
color);
622 return d->filter->strength();
757 return d->filter->radius();
766 d->filter->setRadius(radius);
791 return d->filter->blurHints();
797 if (
d->filter->blurHints() == hints)
800 d->filter->setBlurHints(hints);
817 return d->filter->boundingRectFor(
rect);
826 if (
d->filter->radius() < 1) {
893 return d->filter->offset();
899 if (
d->filter->offset() ==
offset)
948 return d->filter->blurRadius();
981 return d->filter->color();
987 if (
d->filter->color() ==
color)
990 d->filter->setColor(
color);
1008 return d->filter->boundingRectFor(
rect);
1017 if (
d->filter->blurRadius() <= 0 &&
d->filter->offset().isNull()) {
1096 d->isFullyOpaque = 0;
1127 return d->opacityMask;
1133 if (
d->opacityMask ==
mask)
1136 d->opacityMask =
mask;
1158 if (
d->isFullyTransparent)
1162 if (
d->isFullyOpaque && !
d->hasOpacityMask) {
1176 if (
d->hasOpacityMask) {
1201#include "moc_qgraphicseffect.cpp"
1202#include "moc_qgraphicseffect_p.cpp"
The QColor class provides colors based on RGB, HSV or CMYK values.
The QGraphicsBlurEffect class provides a blur effect.
~QGraphicsBlurEffect()
Destroys the effect.
void draw(QPainter *painter) override
\reimp
void blurHintsChanged(BlurHints hints)
This signal is emitted whenever the effect's blur hints changes.
QGraphicsBlurEffect(QObject *parent=nullptr)
Constructs a new QGraphicsBlurEffect instance.
void blurRadiusChanged(qreal blurRadius)
This signal is emitted whenever the effect's blur radius changes.
void setBlurRadius(qreal blurRadius)
qreal blurRadius
the blur radius of the effect.
QRectF boundingRectFor(const QRectF &rect) const override
\reimp
void setBlurHints(BlurHints hints)
BlurHints blurHints
the blur hint of the effect.
The QGraphicsColorizeEffect class provides a colorize effect.
void draw(QPainter *painter) override
\reimp
void setStrength(qreal strength)
QColor color
the color of the effect.
void setColor(const QColor &c)
qreal strength
the strength of the effect.
~QGraphicsColorizeEffect()
Destroys the effect.
QGraphicsColorizeEffect(QObject *parent=nullptr)
Constructs a new QGraphicsColorizeEffect instance.
void strengthChanged(qreal strength)
This signal is emitted whenever setStrength() changes the colorize strength property.
void colorChanged(const QColor &color)
This signal is emitted whenever the effect's color changes.
The QGraphicsDropShadowEffect class provides a drop shadow effect.
void colorChanged(const QColor &color)
This signal is emitted whenever the effect's color changes.
void draw(QPainter *painter) override
\reimp
void blurRadiusChanged(qreal blurRadius)
This signal is emitted whenever the effect's blur radius changes.
QGraphicsDropShadowEffect(QObject *parent=nullptr)
Constructs a new QGraphicsDropShadowEffect instance.
void setColor(const QColor &color)
void offsetChanged(const QPointF &offset)
This signal is emitted whenever the effect's shadow offset changes.
QRectF boundingRectFor(const QRectF &rect) const override
\reimp
void setBlurRadius(qreal blurRadius)
QColor color
the color of the drop shadow.
void setOffset(const QPointF &ofs)
QPointF offset
the shadow offset in pixels.
qreal blurRadius
the blur radius in pixels of the drop shadow.
~QGraphicsDropShadowEffect()
Destroys the effect.
~QGraphicsEffectPrivate()
virtual ~QGraphicsEffectSourcePrivate()
void setCachedOffset(const QPoint &offset)
void invalidateCache(InvalidateReason reason=SourceChanged) const
The QGraphicsEffectSource class represents the source on which a QGraphicsEffect is installed on.
const QGraphicsItem * graphicsItem() const
Returns a pointer to the item if this source is a QGraphicsItem; otherwise returns \nullptr.
QRectF boundingRect(Qt::CoordinateSystem coordinateSystem=Qt::LogicalCoordinates) const
Returns the bounding rectangle of the source mapped to the given system.
bool isPixmap() const
Returns true if the source effectively is a pixmap, e.g., a QGraphicsPixmapItem.
const QStyleOption * styleOption() const
Returns a pointer to the style options (used when drawing the source) if available; otherwise returns...
void update()
Schedules a redraw of the source.
QPixmap pixmap(Qt::CoordinateSystem system=Qt::LogicalCoordinates, QPoint *offset=nullptr, QGraphicsEffect::PixmapPadMode mode=QGraphicsEffect::PadToEffectiveBoundingRect) const
Returns a pixmap with the source painted into it.
~QGraphicsEffectSource()
Destroys the effect source.
QGraphicsEffectSource(QGraphicsEffectSourcePrivate &dd, QObject *parent=nullptr)
void draw(QPainter *painter)
Draws the source using the given painter.
const QWidget * widget() const
Returns a pointer to the widget if this source is a QWidget; otherwise returns \nullptr.
The QGraphicsEffect class is the base class for all graphics effects.
void drawSource(QPainter *painter)
Draws the source directly using the given painter.
QRectF boundingRect() const
Returns the effective bounding rectangle for this effect, i.e., the bounding rectangle of the source ...
QPixmap sourcePixmap(Qt::CoordinateSystem system=Qt::LogicalCoordinates, QPoint *offset=nullptr, PixmapPadMode mode=PadToEffectiveBoundingRect) const
Returns a pixmap with the source painted into it.
void updateBoundingRect()
This function notifies the effect framework when the effect's bounding rectangle has changed.
virtual ~QGraphicsEffect()
Removes the effect from the source, and destroys the graphics effect.
bool sourceIsPixmap() const
Returns true if the source effectively is a pixmap, e.g., a QGraphicsPixmapItem.
void update()
Schedules a redraw of the effect.
void setEnabled(bool enable)
void enabledChanged(bool enabled)
This signal is emitted whenever the effect is enabled or disabled.
PixmapPadMode
This enum describes how the pixmap returned from sourcePixmap should be padded.
@ PadToEffectiveBoundingRect
QGraphicsEffectSource * source() const
virtual void sourceChanged(ChangeFlags flags)
This virtual function is called by QGraphicsEffect to notify the effect that the source has changed.
virtual QRectF boundingRectFor(const QRectF &sourceRect) const
Returns the effective bounding rectangle for this effect, given the provided rect in the device coord...
QGraphicsEffect(QObject *parent=nullptr)
Constructs a new QGraphicsEffect instance having the specified parent.
QRectF sourceBoundingRect(Qt::CoordinateSystem system=Qt::LogicalCoordinates) const
Returns the bounding rectangle of the source mapped to the given system.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
The QGraphicsOpacityEffect class provides an opacity effect.
qreal opacity
the opacity of the effect.
void opacityMaskChanged(const QBrush &mask)
This signal is emitted whenever the effect's opacity mask changes.
void setOpacityMask(const QBrush &mask)
QBrush opacityMask
the opacity mask of the effect.
void setOpacity(qreal opacity)
QGraphicsOpacityEffect(QObject *parent=nullptr)
Constructs a new QGraphicsOpacityEffect instance.
void draw(QPainter *painter) override
\reimp
~QGraphicsOpacityEffect()
Destroys the effect.
void opacityChanged(qreal opacity)
This signal is emitted whenever the effect's opacity changes.
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
QPixmap pixmap() const
Returns the item's pixmap, or an invalid QPixmap if no pixmap has been set.
QPointF offset() const
Returns the pixmap item's offset, which defines the point of the top-left corner of the pixmap,...
The QPainter class performs low-level painting on widgets and other paint devices.
RenderHints renderHints() const
Returns a flag that specifies the rendering hints that are set for this painter.
void restore()
Restores the current painter state (pops a saved state off the stack).
const QTransform & worldTransform() const
Returns the world transformation matrix.
void setOpacity(qreal opacity)
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
void save()
Saves the current painter state (pushes the state onto a stack).
void setWorldTransform(const QTransform &matrix, bool combine=false)
Sets the world transformation matrix.
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
@ CompositionMode_DestinationIn
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
void setRenderHints(RenderHints hints, bool on=true)
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
static bool find(const QString &key, QPixmap *pixmap)
Looks for a cached pixmap associated with the given key in the cache.
static void remove(const QString &key)
Removes the pixmap associated with key from the cache.
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
\inmodule QtCore\reentrant
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QStyleOption class stores the parameters used by QStyle functions.
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
constexpr const T & qBound(const T &min, const T &val, const T &max)
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
QFileInfo info(fileName)
[8]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent