summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-03-03 23:56:40 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-03 23:56:40 (GMT)
commit68bc94ee824d8ceaaa272b7176f3810337addee7 (patch)
tree0837be351ba3097eb09ab8a30f33c5705d4d3cc6
parent89a478c8c747b2f572deb88d028715e88c16853e (diff)
parent7ab3b4d96a0cedb50d2c1ce5bfe9eed315548c4f (diff)
downloadQt-68bc94ee824d8ceaaa272b7176f3810337addee7.zip
Qt-68bc94ee824d8ceaaa272b7176f3810337addee7.tar.gz
Qt-68bc94ee824d8ceaaa272b7176f3810337addee7.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
-rwxr-xr-xdemos/declarative/samegame/SamegameCore/samegame.js2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeparticles.cpp16
-rw-r--r--src/declarative/qml/qdeclarativebinding_p.h4
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeproperty_p.h2
-rw-r--r--tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp3
6 files changed, 26 insertions, 5 deletions
diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js
index c0f10bd..1214b79 100755
--- a/demos/declarative/samegame/SamegameCore/samegame.js
+++ b/demos/declarative/samegame/SamegameCore/samegame.js
@@ -4,7 +4,7 @@ var maxX = 10;//Nums are for gameCanvas.tileSize 40
var maxY = 15;
var maxIndex = maxX*maxY;
var board = new Array(maxIndex);
-var tileSrc = "content/BoomBlock.qml";
+var tileSrc = "SamegameCore/BoomBlock.qml";
var scoresURL = "http://qtfx-nokia.trolltech.com.au/samegame/scores.php";
var scoresURL = "";
var timer;
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()
diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h
index ec5809d..1a714f0 100644
--- a/src/declarative/qml/qdeclarativebinding_p.h
+++ b/src/declarative/qml/qdeclarativebinding_p.h
@@ -64,7 +64,7 @@
QT_BEGIN_NAMESPACE
-class Q_AUTOTEST_EXPORT QDeclarativeAbstractBinding
+class Q_DECLARATIVE_EXPORT QDeclarativeAbstractBinding
{
public:
QDeclarativeAbstractBinding();
@@ -101,7 +101,7 @@ private:
class QDeclarativeContext;
class QDeclarativeBindingPrivate;
-class Q_AUTOTEST_EXPORT QDeclarativeBinding : public QDeclarativeExpression, public QDeclarativeAbstractBinding
+class Q_DECLARATIVE_EXPORT QDeclarativeBinding : public QDeclarativeExpression, public QDeclarativeAbstractBinding
{
Q_OBJECT
public:
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index ecaea61..bd67b0b 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -1383,7 +1383,11 @@ public:
paths += QFileInfo(base.toLocalFile()).path();
paths += importPath;
paths += QDeclarativeEnginePrivate::get(engine)->environmentImportPath;
+#if (QT_VERSION >= QT_VERSION_CHECK(4,7,0))
QString builtinPath = QLibraryInfo::location(QLibraryInfo::ImportsPath);
+#else
+ QString builtinPath;
+#endif
if (!builtinPath.isEmpty())
paths += builtinPath;
diff --git a/src/declarative/qml/qdeclarativeproperty_p.h b/src/declarative/qml/qdeclarativeproperty_p.h
index 1fda7f4..c31e2d3 100644
--- a/src/declarative/qml/qdeclarativeproperty_p.h
+++ b/src/declarative/qml/qdeclarativeproperty_p.h
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
class QDeclarativeContext;
class QDeclarativeEnginePrivate;
class QDeclarativeExpression;
-class Q_AUTOTEST_EXPORT QDeclarativePropertyPrivate
+class Q_DECLARATIVE_EXPORT QDeclarativePropertyPrivate
{
public:
enum WriteFlag { BypassInterceptor = 0x01, DontRemoveBinding = 0x02 };
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
index 15caea6..9957b50 100644
--- a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
+++ b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp
@@ -71,8 +71,9 @@ private:
QEventLoop loop;
QVERIFY(connect(worker, SIGNAL(done()), &loop, SLOT(quit())));
QTimer timer;
+ timer.setSingleShot(true);
connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
- timer.start(1000);
+ timer.start(10000);
loop.exec();
QVERIFY(timer.isActive());
}