summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-20 18:26:46 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-20 18:26:46 (GMT)
commit4d344bbc7a780e861f83962a166e82a0648813f1 (patch)
tree8f6937de28c90cd7720a8e38e0312d6b8a138125 /tests
parent8678d9b5e70f6076e1e915d8bf3938136fe4018c (diff)
parent3ff96da38b0906a6b2e398aea3469b1ab3c72e2c (diff)
downloadQt-4d344bbc7a780e861f83962a166e82a0648813f1.zip
Qt-4d344bbc7a780e861f83962a166e82a0648813f1.tar.gz
Qt-4d344bbc7a780e861f83962a166e82a0648813f1.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: Make Item::transformOriginPoint read-only Ensure the boundingRect() of Text is correctly calculated. Better defaults for MouseArea's drag. various doc improvements for animation elements fixes for dynamic object creation docs Change docs to show how to define enum properties Improve documentation on setting arbitray transform origin points Ensure released VisualItemModel items are removed from the scene. Improve QML text rendering when LCD smoothing is enabled for OS X.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml29
-rw-r--r--tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp9
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp1
3 files changed, 35 insertions, 4 deletions
diff --git a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
index e8dd8cc..4810736 100644
--- a/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
+++ b/tests/auto/declarative/qdeclarativerepeater/data/itemlist.qml
@@ -4,21 +4,27 @@
import Qt 4.7
Rectangle {
+ id: root
color: "lightgray"
width: 240
height: 320
+ property variant itemModel: itemModel1
function checkProperties() {
testObject.error = false;
- if (testObject.useModel && view.model != itemModel) {
+ if (testObject.useModel && view.model != root.itemModel) {
console.log("model property incorrect");
testObject.error = true;
}
}
+ function switchModel() {
+ root.itemModel = itemModel2
+ }
+
VisualItemModel {
- id: itemModel
- objectName: "itemModel"
+ id: itemModel1
+ objectName: "itemModel1"
Rectangle {
objectName: "item1"
height: 50; width: 100; color: "#FFFEF0"
@@ -36,12 +42,27 @@ Rectangle {
}
}
+ VisualItemModel {
+ id: itemModel2
+ objectName: "itemModel2"
+ Rectangle {
+ objectName: "item4"
+ height: 50; width: 100; color: "#FFFEF0"
+ Text { objectName: "text4"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item5"
+ height: 50; width: 100; color: "#F0FFF7"
+ Text { objectName: "text5"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
Column {
objectName: "container"
Repeater {
id: view
objectName: "repeater"
- model: testObject.useModel ? itemModel : 0
+ model: testObject.useModel ? root.itemModel : 0
}
}
}
diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
index 7299a43..623b3d7 100644
--- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
+++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp
@@ -361,6 +361,15 @@ void tst_QDeclarativeRepeater::itemModel()
QVERIFY(qobject_cast<QObject*>(container->childItems().at(2))->objectName() == "item3");
QVERIFY(container->childItems().at(3) == repeater);
+ QMetaObject::invokeMethod(canvas->rootObject(), "switchModel");
+ QCOMPARE(container->childItems().count(), 3);
+ QVERIFY(qobject_cast<QObject*>(container->childItems().at(0))->objectName() == "item4");
+ QVERIFY(qobject_cast<QObject*>(container->childItems().at(1))->objectName() == "item5");
+ QVERIFY(container->childItems().at(2) == repeater);
+
+ testObject->setUseModel(false);
+ QCOMPARE(container->childItems().count(), 1);
+
delete testObject;
delete canvas;
}
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index 80198eb..53862ec 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -246,6 +246,7 @@ void tst_qdeclarativetext::width()
QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create());
QVERIFY(textObject != 0);
+ QVERIFY(textObject->boundingRect().width() > 0);
QCOMPARE(textObject->width(), qreal(metricWidth));
QVERIFY(textObject->textFormat() == QDeclarativeText::AutoText); // setting text doesn't change format
}