diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-16 04:28:36 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-16 04:28:36 (GMT) |
commit | d51de46fe6d52126c57623156a5c7e4ed61a51a7 (patch) | |
tree | 7b9c2c14b87a2696c4db1df1bd7dcb5239e22d8d | |
parent | 15e8301c3029646bfc2b78b821a0688ee7b287ae (diff) | |
parent | 86f89023b52e00d155d6b14762f1a99a70d67e60 (diff) | |
download | Qt-d51de46fe6d52126c57623156a5c7e4ed61a51a7.zip Qt-d51de46fe6d52126c57623156a5c7e4ed61a51a7.tar.gz Qt-d51de46fe6d52126c57623156a5c7e4ed61a51a7.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | doc/src/declarative/network.qdoc | 4 | ||||
-rw-r--r-- | src/declarative/util/qmlstate.cpp | 7 | ||||
-rw-r--r-- | tests/auto/declarative/qmlbinding/data/test-binding.qml | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp | 6 | ||||
-rw-r--r-- | tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp | 2 | ||||
-rw-r--r-- | tests/auto/declarative/states/data/explicit.qml | 1 | ||||
-rw-r--r-- | tests/auto/declarative/states/tst_states.cpp | 20 |
7 files changed, 37 insertions, 5 deletions
diff --git a/doc/src/declarative/network.qdoc b/doc/src/declarative/network.qdoc index a81eb0f..4ed5ca2 100644 --- a/doc/src/declarative/network.qdoc +++ b/doc/src/declarative/network.qdoc @@ -91,8 +91,8 @@ Image { \endqml The \l Image source property will be assigned \tt{http://example.com/mystuff/images/logo.png}, -but while the QML is being developed, in say \tt C:\User\Fred\Documents\MyStuff\test.qml, it will be assigned -\tt C:\User\Fred\Documents\MyStuff\images\logo.png. +but while the QML is being developed, in say \tt C:\\User\\Fred\\Documents\\MyStuff\\test.qml, it will be assigned +\tt C:\\User\\Fred\\Documents\\MyStuff\\images\\logo.png. If the string assigned to a URL is already an absolute URL, then "resolving" does not change it and the URL is assigned directly. diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index 7cc548f..1f5dbad 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -433,8 +433,11 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever // Output for debugging if (stateChangeDebug()) { foreach(const Action &action, applyList) { - qWarning() << " Action:" << action.property.object() - << action.property.name() << action.toValue; + if (action.event) + qWarning() << " Action event:" << action.event; + else + qWarning() << " Action:" << action.property.object() + << action.property.name() << action.toValue; } } diff --git a/tests/auto/declarative/qmlbinding/data/test-binding.qml b/tests/auto/declarative/qmlbinding/data/test-binding.qml index d2a22f5..e9101e4 100644 --- a/tests/auto/declarative/qmlbinding/data/test-binding.qml +++ b/tests/auto/declarative/qmlbinding/data/test-binding.qml @@ -10,7 +10,7 @@ Rectangle { Rectangle { id: r1; width: 1; height: 1; color: "yellow" } Rectangle { id: r2; width: 1; height: 1; color: "red" } - Binding { target: screen; property: "text"; value: s1.text } + Binding { target: screen; property: "text"; value: s1.text; objectName: "binding1" } Binding { target: screen; property: "color"; value: r1.color } Binding { target: screen; property: "color"; when: screen.changeColor == true; value: r2.color } } diff --git a/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp b/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp index e5aacc7..0a8508a 100644 --- a/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp +++ b/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp @@ -77,6 +77,12 @@ void tst_qmlbinding::binding() rect->setProperty("changeColor", true); QCOMPARE(rect->color(), QColor("red")); + QmlBind *binding = qobject_cast<QmlBind*>(rect->findChild<QmlBind*>("binding1")); + QVERIFY(binding != 0); + QCOMPARE(binding->object(), rect); + QCOMPARE(binding->property(), QLatin1String("text")); + QCOMPARE(binding->value().toString(), QLatin1String("Hello")); + delete rect; } diff --git a/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp b/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp index 2648463..008dfb3 100644 --- a/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp +++ b/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp @@ -103,6 +103,7 @@ void tst_qmlsystempalette::inactivePalette() QmlSystemPalette *object = qobject_cast<QmlSystemPalette*>(component.create()); QVERIFY(object != 0); + QVERIFY(object->colorGroup() == QmlSystemPalette::Inactive); QPalette palette; palette.setCurrentColorGroup(QPalette::Inactive); @@ -131,6 +132,7 @@ void tst_qmlsystempalette::disabledPalette() QmlSystemPalette *object = qobject_cast<QmlSystemPalette*>(component.create()); QVERIFY(object != 0); + QVERIFY(object->colorGroup() == QmlSystemPalette::Disabled); QPalette palette; palette.setCurrentColorGroup(QPalette::Disabled); diff --git a/tests/auto/declarative/states/data/explicit.qml b/tests/auto/declarative/states/data/explicit.qml index 271115a..ca7e274 100644 --- a/tests/auto/declarative/states/data/explicit.qml +++ b/tests/auto/declarative/states/data/explicit.qml @@ -7,6 +7,7 @@ Rectangle { states: State { name: "blue" PropertyChanges { + objectName: "changes" target: MyRectangle; explicit: true color: sourceColor } diff --git a/tests/auto/declarative/states/tst_states.cpp b/tests/auto/declarative/states/tst_states.cpp index 3d8f303..fe90191 100644 --- a/tests/auto/declarative/states/tst_states.cpp +++ b/tests/auto/declarative/states/tst_states.cpp @@ -42,6 +42,7 @@ #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> #include <private/qmlgraphicsrectangle_p.h> +#include <private/qmlpropertychanges_p.h> class tst_states : public QObject { @@ -61,6 +62,7 @@ private slots: void script(); void restoreEntryValues(); void explicitChanges(); + void propertyErrors(); }; void tst_states::basicChanges() @@ -544,6 +546,10 @@ void tst_states::explicitChanges() QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); QVERIFY(rect != 0); + QmlPropertyChanges *changes = qobject_cast<QmlPropertyChanges*>(rect->findChild<QmlPropertyChanges*>("changes")); + QVERIFY(changes != 0); + QVERIFY(changes->isExplicit()); + QCOMPARE(rect->color(),QColor("red")); rect->setState("blue"); @@ -561,6 +567,20 @@ void tst_states::explicitChanges() QCOMPARE(rect->color(),QColor("yellow")); } +void tst_states::propertyErrors() +{ + QmlEngine engine; + QmlComponent rectComponent(&engine, SRCDIR "/data/propertyErrors.qml"); + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); + QVERIFY(rect != 0); + + QCOMPARE(rect->color(),QColor("red")); + + QTest::ignoreMessage(QtWarningMsg, "QML QmlPropertyChanges (file://" SRCDIR "/data/propertyErrors.qml:8:9) Cannot assign to non-existant property \"colr\""); + QTest::ignoreMessage(QtWarningMsg, "QML QmlPropertyChanges (file://" SRCDIR "/data/propertyErrors.qml:8:9) Cannot assign to read-only property \"wantsFocus\""); + rect->setState("blue"); +} + QTEST_MAIN(tst_states) #include "tst_states.moc" |