From d904fe2273be5d39b54b987eef6b9cc0d1b85c4b Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 13 Aug 2010 10:10:38 +1000 Subject: Fix configure -help output. declarative module is built by default. Task-number: QTBUG-12840 --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 35fe2eb..7c3f9a3 100755 --- a/configure +++ b/configure @@ -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). -- cgit v0.12 From f9fe93e6e85294274d4e0ce81db09783cfacd733 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 13 Aug 2010 12:22:46 +1000 Subject: Clear previous animation data for non-triggering animations. We need to clear the data from the last run if the animation doesn't match any of the state actions (or if there are no actions). Task-number: QTBUG-12805 --- src/declarative/util/qdeclarativeanimation.cpp | 2 ++ .../data/nonTransitionBug.qml | 30 +++++++++++++++++++++ .../tst_qdeclarativeanimations.cpp | 31 ++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml 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 #include +#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(c.create()); + QVERIFY(rect != 0); + QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect); + QDeclarativeRectangle *mover = rect->findChild("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" -- cgit v0.12 From ade18bab3a2c4c877baa9be2a0012d670dafb64a Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 13 Aug 2010 17:09:27 +1000 Subject: Add autotest that checks that copy and cut don't work when echomode is set to hide text/password mode Task-number: QTBUG-12086 Reviewed-by: Michael Brasser --- .../tst_qdeclarativetextinput.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 } -- cgit v0.12