diff options
5 files changed, 41 insertions, 7 deletions
diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc index e6c02c06e9..361f6e61ee 100644 --- a/src/qml/doc/src/whatsnew.qdoc +++ b/src/qml/doc/src/whatsnew.qdoc @@ -30,10 +30,10 @@ \page qtqml-releasenotes.html \inqmlmodule QtQuick 2.0 -\section1 Qt 5.0 +\section1 Qt QML in Qt 5 -The QtQml C++ module is new in Qt 5. It provides the QML engine and implements -the QML language supporting infrastructure. +The \l{Qt QML} module is new in Qt 5.0. It provides the QML engine and +implements the QML language supporting infrastructure. (Prior to Qt 5, this functionality was provided by the QtDeclarative module, which has now been replaced by the new QtQml and QtQuick C++ modules. See the @@ -100,4 +100,3 @@ has now been replaced by the new QtQml and QtQuick C++ modules. See the \endlist */ - diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 6b8f9927c4..210e9f23f5 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -96,7 +96,7 @@ const char *QSGTextMaskMaterialData::fragmentShader() const { "uniform sampler2D texture; \n" "uniform lowp vec4 color; \n" "void main() { \n" - " gl_FragColor = vec4(texture2D(texture, sampleCoord).rgb, 1.0); \n" + " gl_FragColor = vec4(texture2D(texture, sampleCoord).rgb * color.a, 1.0); \n" "}"; } diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp index 021ff75f03..9dd9aa2e6d 100644 --- a/src/quick/util/qquicksmoothedanimation.cpp +++ b/src/quick/util/qquicksmoothedanimation.cpp @@ -153,10 +153,10 @@ bool QSmoothedAnimation::recalc() s = (invert? -1.0: 1.0) * s; - if (userDuration > 0 && velocity > 0) { + if (userDuration >= 0 && velocity > 0) { tf = s / velocity; if (tf > (userDuration / 1000.)) tf = (userDuration / 1000.); - } else if (userDuration > 0) { + } else if (userDuration >= 0) { tf = userDuration / 1000.; } else if (velocity > 0) { tf = s / velocity; diff --git a/tests/auto/quick/qquicksmoothedanimation/data/smoothedanimationZeroDuration.qml b/tests/auto/quick/qquicksmoothedanimation/data/smoothedanimationZeroDuration.qml new file mode 100644 index 0000000000..d0183ad00c --- /dev/null +++ b/tests/auto/quick/qquicksmoothedanimation/data/smoothedanimationZeroDuration.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Rectangle { + width: 300; height: 300; + Rectangle { + objectName: "theRect" + color: "red" + width: 60; height: 60; + x: 100; y: 100; + SmoothedAnimation on x { objectName: "easeX"; to: 200; duration: 0 } + } +} diff --git a/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp b/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp index 935543cc34..705ee5cf46 100644 --- a/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp +++ b/tests/auto/quick/qquicksmoothedanimation/tst_qquicksmoothedanimation.cpp @@ -60,6 +60,7 @@ private slots: void valueSource(); void behavior(); void deleteOnUpdate(); + void zeroDuration(); private: QQmlEngine engine; @@ -237,6 +238,28 @@ void tst_qquicksmoothedanimation::deleteOnUpdate() delete rect; } +void tst_qquicksmoothedanimation::zeroDuration() +{ + QQmlEngine engine; + + QQmlComponent c(&engine, testFileUrl("smoothedanimationZeroDuration.qml")); + + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); + QVERIFY(rect); + + QQuickRectangle *theRect = rect->findChild<QQuickRectangle*>("theRect"); + QVERIFY(theRect); + + QQuickSmoothedAnimation *easeX = rect->findChild<QQuickSmoothedAnimation*>("easeX"); + QVERIFY(easeX); + QVERIFY(easeX->isRunning()); + + QTRY_VERIFY(!easeX->isRunning()); + QTRY_COMPARE(theRect->x(), qreal(200)); + + delete rect; +} + QTEST_MAIN(tst_qquicksmoothedanimation) #include "tst_qquicksmoothedanimation.moc" |