summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-28 14:57:35 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-29 06:43:32 (GMT)
commitf55576b670c69b69c5f1140661cf20cbda96853a (patch)
tree88d6c6bdd478b360eb6aa07e3f9cb9cb74523f91 /src/gui/graphicsview/qgraphicsitem.cpp
parent72debacc7f57b9ea9115e549170341a9ad11bf0f (diff)
downloadQt-f55576b670c69b69c5f1140661cf20cbda96853a.zip
Qt-f55576b670c69b69c5f1140661cf20cbda96853a.tar.gz
Qt-f55576b670c69b69c5f1140661cf20cbda96853a.tar.bz2
add support for passing arbitrary painters into
QGraphicsEffectSource::draw
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 425031f..120ca05 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -9939,9 +9939,19 @@ QRectF QGraphicsItemEffectSourcePrivate::boundingRect(bool deviceCoordinates) co
void QGraphicsItemEffectSourcePrivate::draw(QPainter *painter)
{
- QGraphicsScenePrivate *scened = item->d_ptr->scene->d_func();
- scened->draw(item, painter, info->viewTransform, info->transformPtr, info->exposedRegion,
- info->widget, info->opacity, 0, info->wasDirtySceneTransform, info->drawItem);
+ if (painter == info->painter) {
+ QGraphicsScenePrivate *scened = item->d_ptr->scene->d_func();
+ scened->draw(item, painter, info->viewTransform, info->transformPtr, info->exposedRegion,
+ info->widget, info->opacity, 0, info->wasDirtySceneTransform,
+ info->drawItem);
+ } else {
+ QTransform effectTransform = painter->worldTransform();
+ effectTransform *= info->transformPtr->inverted();
+ QGraphicsScenePrivate *scened = item->d_ptr->scene->d_func();
+ scened->draw(item, painter, info->viewTransform, info->transformPtr, info->exposedRegion,
+ info->widget, info->opacity, &effectTransform, info->wasDirtySceneTransform,
+ info->drawItem);
+ }
}
QPixmap QGraphicsItemEffectSourcePrivate::pixmap(bool deviceCoordinates, QPoint *offset) const