Qt 4.8
qgraphicseffect.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
109 #include "qgraphicseffect_p.h"
110 #include "private/qgraphicsitem_p.h"
111 
112 #include <QtGui/qgraphicsitem.h>
113 
114 #include <QtGui/qimage.h>
115 #include <QtGui/qpainter.h>
116 #include <QtGui/qpaintengine.h>
117 #include <QtCore/qrect.h>
118 #include <QtCore/qdebug.h>
119 #include <private/qdrawhelper_p.h>
120 
121 #ifndef QT_NO_GRAPHICSEFFECT
123 
147  : QObject(dd, parent)
148 {}
149 
154 {}
155 
162 {
163  return d_func()->boundingRect(system);
164 }
165 
176 {
177  Q_D(const QGraphicsEffect);
178  if (d->source)
179  return d->source->boundingRect(system);
180  return QRectF();
181 }
182 
190 {
191  return d_func()->graphicsItem();
192 }
193 
201 {
202  return d_func()->widget();
203 }
204 
212 {
213  return d_func()->styleOption();
214 }
215 
224 {
225  Q_D(const QGraphicsEffectSource);
226 
227  QPixmap pm;
228  if (QPixmapCache::find(d->m_cacheKey, &pm)) {
229  QTransform restoreTransform;
230  if (d->m_cachedSystem == Qt::DeviceCoordinates) {
231  restoreTransform = painter->worldTransform();
232  painter->setWorldTransform(QTransform());
233  }
234 
235  painter->drawPixmap(d->m_cachedOffset, pm);
236 
237  if (d->m_cachedSystem == Qt::DeviceCoordinates)
238  painter->setWorldTransform(restoreTransform);
239  } else {
240  d_func()->draw(painter);
241  }
242 }
243 
256 {
257  Q_D(const QGraphicsEffect);
258  if (d->source)
259  d->source->draw(painter);
260 }
261 
270 {
271  d_func()->update();
272 }
273 
283 {
284  return d_func()->isPixmap();
285 }
286 
296 {
297  return source() ? source()->isPixmap() : false;
298 }
299 
316 {
317  Q_D(const QGraphicsEffectSource);
318 
319  // Shortcut, no cache for childless pixmap items...
320  const QGraphicsItem *item = graphicsItem();
321  if (system == Qt::LogicalCoordinates && mode == QGraphicsEffect::NoPad && item && isPixmap()) {
322  const QGraphicsPixmapItem *pixmapItem = static_cast<const QGraphicsPixmapItem *>(item);
323  if (offset)
324  *offset = pixmapItem->offset().toPoint();
325  return pixmapItem->pixmap();
326  }
327 
328  if (system == Qt::DeviceCoordinates && item
329  && !static_cast<const QGraphicsItemEffectSourcePrivate *>(d_func())->info) {
330  qWarning("QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context");
331  return QPixmap();
332  }
333 
334  QPixmap pm;
335  if (item && d->m_cachedSystem == system && d->m_cachedMode == mode)
336  QPixmapCache::find(d->m_cacheKey, &pm);
337 
338  if (pm.isNull()) {
339  pm = d->pixmap(system, &d->m_cachedOffset, mode);
340  d->m_cachedSystem = system;
341  d->m_cachedMode = mode;
342 
343  d->invalidateCache();
344  d->m_cacheKey = QPixmapCache::insert(pm);
345  }
346 
347  if (offset)
348  *offset = d->m_cachedOffset;
349 
350  return pm;
351 }
352 
371 {
372  Q_D(const QGraphicsEffect);
373  if (d->source)
374  return d->source->pixmap(system, offset, mode);
375  return QPixmap();
376 }
377 
379 {
380  invalidateCache();
381 }
382 
384 {
385  m_cachedOffset = offset;
386 }
387 
389 {
391  && (reason == EffectRectChanged
392  || (reason == TransformChanged && m_cachedSystem == Qt::LogicalCoordinates))) {
393  return;
394  }
395 
396  QPixmapCache::remove(m_cacheKey);
397 }
398 
404  : QObject(*new QGraphicsEffectPrivate, parent)
405 {
406 }
407 
412  : QObject(dd, parent)
413 {
414 }
415 
420 {
422  d->setGraphicsEffectSource(0);
423 }
424 
433 {
434  Q_D(const QGraphicsEffect);
435  if (d->source)
436  return boundingRectFor(d->source->boundingRect());
437  return QRectF();
438 }
439 
450 {
451  return rect;
452 }
453 
471 {
472  Q_D(const QGraphicsEffect);
473  return d->isEnabled;
474 }
475 
477 {
479  if (d->isEnabled == enable)
480  return;
481 
482  d->isEnabled = enable;
483  if (d->source) {
484  d->source->d_func()->effectBoundingRectChanged();
485  d->source->d_func()->invalidateCache();
486  }
487  emit enabledChanged(enable);
488 }
489 
509 {
511  if (d->source)
512  d->source->update();
513 }
514 
527 {
528  Q_D(const QGraphicsEffect);
529  return d->source;
530 }
531 
543 {
545  if (d->source) {
546  d->source->d_func()->effectBoundingRectChanged();
547  d->source->d_func()->invalidateCache(QGraphicsEffectSourcePrivate::EffectRectChanged);
548  }
549 }
550 
607 void QGraphicsEffect::sourceChanged(ChangeFlags flags)
608 {
609  Q_UNUSED(flags);
610 }
611 
636 {
637 }
638 
643 {
644 }
645 
656 {
658  return d->filter->color();
659 }
660 
662 {
664  if (d->filter->color() == color)
665  return;
666 
667  d->filter->setColor(color);
668  update();
669  emit colorChanged(color);
670 }
671 
683 {
685  return d->filter->strength();
686 }
687 
689 {
691  if (qFuzzyCompare(d->filter->strength(), strength))
692  return;
693 
694  d->filter->setStrength(strength);
695  d->opaque = !qFuzzyIsNull(strength);
696  update();
697  emit strengthChanged(strength);
698 }
699 
723 {
725 
726  if (!d->opaque) {
727  drawSource(painter);
728  return;
729  }
730 
731  QPoint offset;
732  if (sourceIsPixmap()) {
733  // No point in drawing in device coordinates (pixmap will be scaled anyways).
734  const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset, NoPad);
735  if (!pixmap.isNull())
736  d->filter->draw(painter, offset, pixmap);
737 
738  return;
739  }
740 
741  // Draw pixmap in deviceCoordinates to avoid pixmap scaling.
742  const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset);
743  if (pixmap.isNull())
744  return;
745 
746  QTransform restoreTransform = painter->worldTransform();
747  painter->setWorldTransform(QTransform());
748  d->filter->draw(painter, offset, pixmap);
749  painter->setWorldTransform(restoreTransform);
750 }
751 
804 {
806  d->filter->setBlurHints(QGraphicsBlurEffect::PerformanceHint);
807 }
808 
813 {
814 }
815 
832 {
833  Q_D(const QGraphicsBlurEffect);
834  return d->filter->radius();
835 }
836 
838 {
840  if (qFuzzyCompare(d->filter->radius(), radius))
841  return;
842 
843  d->filter->setRadius(radius);
845  emit blurRadiusChanged(radius);
846 }
847 
871 QGraphicsBlurEffect::BlurHints QGraphicsBlurEffect::blurHints() const
872 {
873  Q_D(const QGraphicsBlurEffect);
874  return d->filter->blurHints();
875 }
876 
877 void QGraphicsBlurEffect::setBlurHints(QGraphicsBlurEffect::BlurHints hints)
878 {
880  if (d->filter->blurHints() == hints)
881  return;
882 
883  d->filter->setBlurHints(hints);
884  emit blurHintsChanged(hints);
885 }
886 
901 {
902  Q_D(const QGraphicsBlurEffect);
903  return d->filter->boundingRectFor(rect);
904 }
905 
910 {
912  if (d->filter->radius() < 1) {
913  drawSource(painter);
914  return;
915  }
916 
918  if (painter->paintEngine()->type() == QPaintEngine::OpenGL2)
919  mode = NoPad;
920 
921  QPoint offset;
922  QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset, mode);
923  if (pixmap.isNull())
924  return;
925 
926  d->filter->draw(painter, offset, pixmap);
927 }
928 
959 {
960 }
961 
966 {
967 }
968 
984 {
986  return d->filter->offset();
987 }
988 
990 {
992  if (d->filter->offset() == offset)
993  return;
994 
995  d->filter->setOffset(offset);
997  emit offsetChanged(offset);
998 }
999 
1051 {
1053  return d->filter->blurRadius();
1054 }
1055 
1057 {
1059  if (qFuzzyCompare(d->filter->blurRadius(), blurRadius))
1060  return;
1061 
1062  d->filter->setBlurRadius(blurRadius);
1064  emit blurRadiusChanged(blurRadius);
1065 }
1066 
1090 {
1092  return d->filter->color();
1093 }
1094 
1096 {
1098  if (d->filter->color() == color)
1099  return;
1100 
1101  d->filter->setColor(color);
1102  update();
1103  emit colorChanged(color);
1104 }
1105 
1120 {
1122  return d->filter->boundingRectFor(rect);
1123 }
1124 
1129 {
1131  if (d->filter->blurRadius() <= 0 && d->filter->offset().isNull()) {
1132  drawSource(painter);
1133  return;
1134  }
1135 
1137  if (painter->paintEngine()->type() == QPaintEngine::OpenGL2)
1138  mode = NoPad;
1139 
1140  // Draw pixmap in device coordinates to avoid pixmap scaling.
1141  QPoint offset;
1142  const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset, mode);
1143  if (pixmap.isNull())
1144  return;
1145 
1146  QTransform restoreTransform = painter->worldTransform();
1147  painter->setWorldTransform(QTransform());
1148  d->filter->draw(painter, offset, pixmap);
1149  painter->setWorldTransform(restoreTransform);
1150 }
1151 
1177 {
1178 }
1179 
1184 {
1185 }
1186 
1202 {
1203  Q_D(const QGraphicsOpacityEffect);
1204  return d->opacity;
1205 }
1206 
1208 {
1210  opacity = qBound(qreal(0.0), opacity, qreal(1.0));
1211 
1212  if (qFuzzyCompare(d->opacity, opacity))
1213  return;
1214 
1215  d->opacity = opacity;
1216  if ((d->isFullyTransparent = qFuzzyIsNull(d->opacity)))
1217  d->isFullyOpaque = 0;
1218  else
1219  d->isFullyOpaque = qFuzzyIsNull(d->opacity - 1);
1220  update();
1221  emit opacityChanged(opacity);
1222 }
1223 
1252 {
1253  Q_D(const QGraphicsOpacityEffect);
1254  return d->opacityMask;
1255 }
1256 
1258 {
1260  if (d->opacityMask == mask)
1261  return;
1262 
1263  d->opacityMask = mask;
1264  d->hasOpacityMask = (mask.style() != Qt::NoBrush);
1265  update();
1266 
1267  emit opacityMaskChanged(mask);
1268 }
1269 
1284 {
1286 
1287  // Transparent; nothing to draw.
1288  if (d->isFullyTransparent)
1289  return;
1290 
1291  // Opaque; draw directly without going through a pixmap.
1292  if (d->isFullyOpaque && !d->hasOpacityMask) {
1293  drawSource(painter);
1294  return;
1295  }
1296 
1297  QPoint offset;
1299  QPixmap pixmap = sourcePixmap(system, &offset, QGraphicsEffect::NoPad);
1300  if (pixmap.isNull())
1301  return;
1302 
1303  painter->save();
1304  painter->setOpacity(d->opacity);
1305 
1306  if (d->hasOpacityMask) {
1307  QPainter pixmapPainter(&pixmap);
1308  pixmapPainter.setRenderHints(painter->renderHints());
1310  if (system == Qt::DeviceCoordinates) {
1311  QTransform worldTransform = painter->worldTransform();
1312  worldTransform *= QTransform::fromTranslate(-offset.x(), -offset.y());
1313  pixmapPainter.setWorldTransform(worldTransform);
1314  pixmapPainter.fillRect(sourceBoundingRect(), d->opacityMask);
1315  } else {
1316  pixmapPainter.translate(-offset);
1317  pixmapPainter.fillRect(pixmap.rect(), d->opacityMask);
1318  }
1319  }
1320 
1321  if (system == Qt::DeviceCoordinates)
1322  painter->setWorldTransform(QTransform());
1323 
1324  painter->drawPixmap(offset, pixmap);
1325  painter->restore();
1326 }
1327 
1328 
1330 
1331 #endif //QT_NO_GRAPHICSEFFECT
QPixmap pixmap(Qt::CoordinateSystem system=Qt::LogicalCoordinates, QPoint *offset=0, QGraphicsEffect::PixmapPadMode mode=QGraphicsEffect::PadToEffectiveBoundingRect) const
Returns a pixmap with the source painted into it.
void draw(QPainter *painter)
Reimplemented Function
void offsetChanged(const QPointF &offset)
This signal is emitted whenever the effect&#39;s shadow offset changes.
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
double d
Definition: qnumeric_p.h:62
CoordinateSystem
Definition: qnamespace.h:1733
void colorChanged(const QColor &color)
This signal is emitted whenever the effect&#39;s color changes.
bool sourceIsPixmap() const
Returns true if the source effectively is a pixmap, e.g., a QGraphicsPixmapItem.
QGraphicsEffectSource(QGraphicsEffectSourcePrivate &dd, QObject *parent=0)
void setBlurHints(BlurHints hints)
QPixmap sourcePixmap(Qt::CoordinateSystem system=Qt::LogicalCoordinates, QPoint *offset=0, PixmapPadMode mode=PadToEffectiveBoundingRect) const
Returns a pixmap with the source painted into it.
qreal blurRadius() const
QRectF boundingRectFor(const QRectF &rect) const
Reimplemented Function
void enabledChanged(bool enabled)
This signal is emitted whenever the effect is enabled or disabled.
QGraphicsColorizeEffect(QObject *parent=0)
Constructs a new QGraphicsColorizeEffect instance.
double qreal
Definition: qglobal.h:1193
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QColor color() const
~QGraphicsDropShadowEffect()
Destroys the effect.
virtual void sourceChanged(ChangeFlags flags)
This virtual function is called by QGraphicsEffect to notify the effect that the source has changed...
virtual ~QGraphicsEffect()
Removes the effect from the source, and destroys the graphics effect.
bool isEnabled() const
QGraphicsDropShadowEffect(QObject *parent=0)
Constructs a new QGraphicsDropShadowEffect instance.
void opacityMaskChanged(const QBrush &mask)
This signal is emitted whenever the effect&#39;s opacity mask changes.
qreal opacity() const
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
void restore()
Restores the current painter state (pops a saved state off the stack).
Definition: qpainter.cpp:1620
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QRectF sourceBoundingRect(Qt::CoordinateSystem system=Qt::LogicalCoordinates) const
Returns the bounding rectangle of the source mapped to the given system.
void setBlurRadius(qreal blurRadius)
void drawSource(QPainter *painter)
Draws the source directly using the given painter.
The QGraphicsEffectSource class represents the source on which a QGraphicsEffect is installed on...
~QGraphicsColorizeEffect()
Destroys the effect.
void draw(QPainter *painter)
Reimplemented Function
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
Definition: qglobal.h:2030
const QGraphicsItem * graphicsItem() const
Returns a pointer to the item if this source is a QGraphicsItem; otherwise returns 0...
The QGraphicsDropShadowEffect class provides a drop shadow effect.
QRectF boundingRect() const
Returns the effective bounding rectangle for this effect, i.e., the bounding rectangle of the source ...
void draw(QPainter *painter)
Draws the source using the given painter.
~QGraphicsOpacityEffect()
Destroys the effect.
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
~QGraphicsBlurEffect()
Destroys the effect.
The QGraphicsBlurEffect class provides a blur effect.
#define Q_D(Class)
Definition: qglobal.h:2482
void draw(QPainter *painter)
Reimplemented Function
void updateBoundingRect()
This function notifies the effect framework when the effect&#39;s bounding rectangle has changed...
void draw(QPainter *painter)
Reimplemented Function
void save()
Saves the current painter state (pushes the state onto a stack).
Definition: qpainter.cpp:1590
static QPixmap * find(const QString &key)
bool isPixmap() const
Returns true if the source effectively is a pixmap, e.g., a QGraphicsPixmapItem.
void setOffset(const QPointF &ofs)
void colorChanged(const QColor &color)
This signal is emitted whenever the effect&#39;s color changes.
void invalidateCache(InvalidateReason reason=SourceChanged) const
QRectF boundingRect(Qt::CoordinateSystem coordinateSystem=Qt::LogicalCoordinates) const
Returns the bounding rectangle of the source mapped to the given system.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
The QGraphicsColorizeEffect class provides a colorize effect.
QRectF boundingRectFor(const QRectF &rect) const
Reimplemented Function
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:67
void blurRadiusChanged(qreal blurRadius)
This signal is emitted whenever the effect&#39;s blur radius changes.
#define emit
Definition: qobjectdefs.h:76
virtual Type type() const =0
Reimplement this function to return the paint engine Type.
void setBlurRadius(qreal blurRadius)
BlurHints blurHints() const
Q_CORE_EXPORT void qWarning(const char *,...)
void blurRadiusChanged(qreal blurRadius)
This signal is emitted whenever the effect&#39;s blur radius changes.
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
Definition: qpainter.cpp:1991
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
PixmapPadMode
This enum describes how the pixmap returned from sourcePixmap should be padded.
QGraphicsOpacityEffect(QObject *parent=0)
Constructs a new QGraphicsOpacityEffect instance.
void setColor(const QColor &c)
QPixmap pixmap() const
Returns the item&#39;s pixmap, or an invalid QPixmap if no pixmap has been set.
void setOpacityMask(const QBrush &mask)
~QGraphicsEffectSource()
Destroys the effect source.
qreal strength() const
void blurHintsChanged(BlurHints hints)
This signal is emitted whenever the effect&#39;s blur hints changes.
void opacityChanged(qreal opacity)
This signal is emitted whenever the effect&#39;s opacity changes.
void setRenderHints(RenderHints hints, bool on=true)
Sets the given render hints on the painter if on is true; otherwise clears the render hints...
Definition: qpainter.cpp:7649
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
The QGraphicsOpacityEffect class provides an opacity effect.
void setCachedOffset(const QPoint &offset)
void setEnabled(bool enable)
void setOpacity(qreal opacity)
void setColor(const QColor &color)
const QTransform & worldTransform() const
Returns the world transformation matrix.
Definition: qpainter.cpp:9652
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
Definition: qpainter.cpp:2422
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition: qpoint.h:376
QObject * parent() const
Returns a pointer to the parent object.
Definition: qobject.h:273
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
Definition: qglobal.h:1219
void update()
Schedules a redraw of the effect.
virtual QRectF boundingRectFor(const QRectF &sourceRect) const
Returns the effective bounding rectangle for this effect, given the provided rect in the device coord...
void setWorldTransform(const QTransform &matrix, bool combine=false)
Sets the world transformation matrix.
Definition: qpainter.cpp:9630
QRect rect() const
Returns the pixmap&#39;s enclosing rectangle.
Definition: qpixmap.cpp:676
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
QGraphicsEffect(QObject *parent=0)
Constructs a new QGraphicsEffect instance having the specified parent.
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
void strengthChanged(qreal strength)
This signal is emitted whenever setStrength() changes the colorize strength property.
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...
Definition: qpainter.cpp:5619
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
Definition: qglobal.h:2043
static void remove(const QString &key)
Removes the pixmap associated with key from the cache.
static QTransform fromTranslate(qreal dx, qreal dy)
Creates a matrix which corresponds to a translation of dx along the x axis and dy along the y axis...
Definition: qtransform.cpp:462
RenderHints renderHints() const
Returns a flag that specifies the rendering hints that are set for this painter.
Definition: qpainter.cpp:7675
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
void setOpacity(qreal opacity)
Sets the opacity of the painter to opacity.
Definition: qpainter.cpp:2139
QPointF offset() const
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
Definition: qpixmap.cpp:615
void setStrength(qreal strength)
QPointF offset() const
Returns the pixmap item&#39;s offset, which defines the point of the top-left corner of the pixmap...
const QStyleOption * styleOption() const
Returns a pointer to the style options (used when drawing the source) if available; otherwise returns...
QGraphicsEffectSource * source() const
Returns a pointer to the source, which provides extra context information that can be useful for the ...
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
QBrush opacityMask() const
QGraphicsBlurEffect(QObject *parent=0)
Constructs a new QGraphicsBlurEffect instance.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
Definition: qpainter.cpp:7420
The QGraphicsEffect class is the base class for all graphics effects.
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
const QWidget * widget() const
Returns a pointer to the widget if this source is a QWidget; otherwise returns 0. ...
void update()
Schedules a redraw of the source.
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
Definition: qpainter.cpp:3311