diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-03 14:56:53 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-03 14:56:54 +0200 |
commit | 9868e6b2f14e146e486e127664789f2978fabed0 (patch) | |
tree | 335e4a8088c1302ba7602e3e79b3b64eb4ace623 | |
parent | aad8f0bcad607544ede63e8154bcdc14f40fd632 (diff) | |
parent | 33afb890aefdfbeae6ccee3e91600388b3068108 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Iec94e513079426e5d87bdd24753863038cee573e
-rw-r--r-- | src/declarative/debugger/qpacketprotocol.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeimageprovider.cpp | 6 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeanimation.cpp | 4 | ||||
-rw-r--r-- | tests/auto/cmake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/auto/cmake/cmake.pro | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp | 20 |
6 files changed, 27 insertions, 8 deletions
diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp index 3184d3f7..369f0610 100644 --- a/src/declarative/debugger/qpacketprotocol.cpp +++ b/src/declarative/debugger/qpacketprotocol.cpp @@ -300,6 +300,7 @@ void QPacketProtocol::send(const QPacket & p) Q_ASSERT(writeBytes == sizeof(qint32)); writeBytes = d->dev->write(p.b); Q_ASSERT(writeBytes == p.b.size()); + Q_UNUSED(writeBytes); } /*! diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp index 94498967..0b14ee6f 100644 --- a/src/declarative/qml/qdeclarativeimageprovider.cpp +++ b/src/declarative/qml/qdeclarativeimageprovider.cpp @@ -115,8 +115,10 @@ public: { ... - QDeclarativeEngine engine; - engine->addImageProvider(QLatin1String("colors"), new ColorPixmapProvider); + QDeclarativeView *view = new QDeclarativeView; + view->engine()->addImageProvider(QLatin1String("colors"), + new ColorPixmapProvider); + view->setSource(QUrl::fromLocalFile("main.qml")); ... } diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 83bfa170..a72df77a 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -160,10 +160,6 @@ void QDeclarativeAbstractAnimationPrivate::commence() q->transition(actions, properties, QDeclarativeAbstractAnimation::Forward); q->qtAnimation()->start(); - if (q->qtAnimation()->state() != QAbstractAnimation::Running) { - running = false; - emit q->completed(); - } } QDeclarativeProperty QDeclarativeAbstractAnimationPrivate::createProperty(QObject *obj, const QString &str, QObject *infoObj) diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 0ce9542b..f5135cbc 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -9,8 +9,6 @@ find_package(Qt5Core REQUIRED) include("${_Qt5CTestMacros}") -set(Qt5_MODULE_TEST_DEPENDS Script Widgets) - test_module_includes( Declarative QDeclarativeEngine ) diff --git a/tests/auto/cmake/cmake.pro b/tests/auto/cmake/cmake.pro index bf2dbcb7..61e8de78 100644 --- a/tests/auto/cmake/cmake.pro +++ b/tests/auto/cmake/cmake.pro @@ -2,4 +2,6 @@ # Cause make to do nothing. TEMPLATE = subdirs +CMAKE_QT_MODULES_UNDER_TEST = declarative + CONFIG += ctest_testcase diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index 00869268..6352d02b 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -47,6 +47,7 @@ #include <private/qdeclarativeitem_p.h> #include <QVariantAnimation> #include <QEasingCurve> +#include <QSignalSpy> class tst_qdeclarativeanimations : public QObject { @@ -82,6 +83,7 @@ private slots: void doubleRegistrationBug(); void alwaysRunToEndRestartBug(); void transitionAssignmentBug(); + void zeroDurationTwoCompletedEmittedBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -850,6 +852,24 @@ void tst_qdeclarativeanimations::transitionAssignmentBug() QCOMPARE(rect->property("nullObject").toBool(), false); } +void tst_qdeclarativeanimations::zeroDurationTwoCompletedEmittedBug() +{ + QDeclarativeRectangle rect; + QDeclarativePropertyAnimation animation; + animation.setTarget(&rect); + animation.setProperty("x"); + animation.setFrom(1); + animation.setTo(200); + animation.setDuration(0); + QVERIFY(animation.from() == 1); + QSignalSpy spy(&animation, SIGNAL(completed(void))); + animation.start(); + QVERIFY(!animation.isRunning()); + QCOMPARE(rect.x(), qreal(200)); + QCOMPARE(spy.size(), 1); +} + + QTEST_MAIN(tst_qdeclarativeanimations) #include "tst_qdeclarativeanimations.moc" |