summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-03-03 06:16:43 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-03-03 06:16:43 (GMT)
commit0b44693aec2eed33cb54876edb7641e981aa883c (patch)
treef4f2d411c6f66777e98e60c14d983ad16a4469e9
parenteac8c842141ef349f223fabfa81c111c24079f11 (diff)
downloadQt-0b44693aec2eed33cb54876edb7641e981aa883c.zip
Qt-0b44693aec2eed33cb54876edb7641e981aa883c.tar.gz
Qt-0b44693aec2eed33cb54876edb7641e981aa883c.tar.bz2
4.6.x compat
-rw-r--r--src/declarative/graphicsitems/qdeclarativeparticles.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeparticles.cpp b/src/declarative/graphicsitems/qdeclarativeparticles.cpp
index 1a58d3f..deabdd6 100644
--- a/src/declarative/graphicsitems/qdeclarativeparticles.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeparticles.cpp
@@ -1260,7 +1260,11 @@ void QDeclarativeParticlesPainter::paint(QPainter *p, const QStyleOptionGraphics
const int myX = x() + parentItem()->x();
const int myY = y() + parentItem()->y();
+#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0))
QVarLengthArray<QPainter::Fragment, 256> pixmapData;
+#else
+ QVarLengthArray<QDrawPixmaps::Data, 256> pixmapData;
+#endif
pixmapData.resize(d->particles.count());
const QRectF sourceRect = d->image.rect();
@@ -1268,20 +1272,32 @@ void QDeclarativeParticlesPainter::paint(QPainter *p, const QStyleOptionGraphics
qreal halfPHeight = sourceRect.height()/2.;
for (int i = 0; i < d->particles.count(); ++i) {
const QDeclarativeParticle &particle = d->particles.at(i);
+#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0))
pixmapData[i].x = particle.x - myX + halfPWidth;
pixmapData[i].y = particle.y - myY + halfPHeight;
+#else
+ pixmapData[i].point = QPointF(particle.x - myX + halfPWidth, particle.y - myY + halfPHeight);
+#endif
pixmapData[i].opacity = particle.opacity;
//these never change
pixmapData[i].rotation = 0;
pixmapData[i].scaleX = 1;
pixmapData[i].scaleY = 1;
+#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0))
pixmapData[i].sourceLeft = sourceRect.left();
pixmapData[i].sourceTop = sourceRect.top();
pixmapData[i].width = sourceRect.width();
pixmapData[i].height = sourceRect.height();
+#else
+ pixmapData[i].source = sourceRect;
+#endif
}
+#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0))
p->drawPixmapFragments(pixmapData.data(), d->particles.count(), d->image);
+#else
+ qDrawPixmaps(p, pixmapData.data(), d->particles.count(), d->image);
+#endif
}
void QDeclarativeParticles::componentComplete()