diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-13 11:53:03 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-13 11:53:03 (GMT) |
commit | 68f38d73d3565a6e59fd60ba61584ebd0b187129 (patch) | |
tree | e0eb3277304e631b4a144c2d00fef281c14efa26 | |
parent | ee62807198a2525577c14f718b98d07ae0ec7bec (diff) | |
parent | ade18bab3a2c4c877baa9be2a0012d670dafb64a (diff) | |
download | Qt-68f38d73d3565a6e59fd60ba61584ebd0b187129.zip Qt-68f38d73d3565a6e59fd60ba61584ebd0b187129.tar.gz Qt-68f38d73d3565a6e59fd60ba61584ebd0b187129.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Add autotest that checks that copy and cut don't work when echomode is set to hide text/password mode
Clear previous animation data for non-triggering animations.
Fix configure -help output. declarative module is built by default.
5 files changed, 89 insertions, 2 deletions
@@ -3677,8 +3677,8 @@ fi -no-scripttools .... Do not build the QtScriptTools module. + -scripttools ....... Build the QtScriptTools module. - + -no-declarative .....Do not build the declarative module. - -declarative ....... Build the declarative module. + -no-declarative .....Do not build the declarative module. + + -declarative ....... Build the declarative module. -platform target ... The operating system and compiler you are building on ($PLATFORM). diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index a747706..2fca09d 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -2392,6 +2392,8 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions d->actions = &data->actions; } else { delete data; + d->va->setFromSourcedValue(0); //clear previous data + d->va->setAnimValue(0, QAbstractAnimation::DeleteWhenStopped); //clear previous data d->actions = 0; } } diff --git a/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml new file mode 100644 index 0000000..e9dc36e --- /dev/null +++ b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml @@ -0,0 +1,30 @@ +import Qt 4.7 + +Rectangle { + id: root + width: 200 + height: 200 + + Rectangle { + id: mover + objectName: "mover" + } + + states: [ + State { + name: "free" + }, + State { + name: "left" + PropertyChanges { + restoreEntryValues: false + target: mover + x: 0 + } + } + ] + + transitions: Transition { + PropertyAnimation { properties: "x"; duration: 50 } + } +} diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index ec867fe..e5943fb 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -48,6 +48,8 @@ #include <QVariantAnimation> #include <QEasingCurve> +#include "../../../shared/util.h" + #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir #define SRCDIR "." @@ -82,6 +84,7 @@ private slots: void easingProperties(); void rotation(); void runningTrueBug(); + void nonTransitionBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -762,6 +765,34 @@ void tst_qdeclarativeanimations::runningTrueBug() QVERIFY(cloud->x() > qreal(0)); } +//QTBUG-12805 +void tst_qdeclarativeanimations::nonTransitionBug() +{ + //tests that the animation values from the previous transition are properly cleared + //in the case where an animation in the transition doesn't match anything (but previously did) + QDeclarativeEngine engine; + + QDeclarativeComponent c(&engine, SRCDIR "/data/nonTransitionBug.qml"); + QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QVERIFY(rect != 0); + QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect); + QDeclarativeRectangle *mover = rect->findChild<QDeclarativeRectangle*>("mover"); + + mover->setX(100); + QCOMPARE(mover->x(), qreal(100)); + + rectPrivate->setState("left"); + QTRY_COMPARE(mover->x(), qreal(0)); + + mover->setX(100); + QCOMPARE(mover->x(), qreal(100)); + + //make sure we don't try to animate back to 0 + rectPrivate->setState("free"); + QTest::qWait(300); + QCOMPARE(mover->x(), qreal(100)); +} + QTEST_MAIN(tst_qdeclarativeanimations) #include "tst_qdeclarativeanimations.moc" diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 6e15a4a..ca9009d 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -741,6 +741,30 @@ void tst_qdeclarativetextinput::copyAndPaste() { textInput->paste(); QCOMPARE(textInput->text(), QString("Hello world!Hello world!")); QCOMPARE(textInput->text().length(), 24); + + // clear copy buffer + QClipboard *clipboard = QApplication::clipboard(); + QVERIFY(clipboard); + clipboard->clear(); + + // test that copy functionality is disabled + // when echo mode is set to hide text/password mode + int index = 0; + while (index < 4) { + QDeclarativeTextInput::EchoMode echoMode = QDeclarativeTextInput::EchoMode(index); + textInput->setEchoMode(echoMode); + textInput->setText("My password"); + textInput->select(0, textInput->text().length());; + textInput->copy(); + if (echoMode == QDeclarativeTextInput::Normal) { + QVERIFY(!clipboard->text().isEmpty()); + QCOMPARE(clipboard->text(), QString("My password")); + clipboard->clear(); + } else { + QVERIFY(clipboard->text().isEmpty()); + } + index++; + } #endif } |