summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-01-06 20:05:55 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-01-06 20:05:55 (GMT)
commit4dd54e88efc6899a0024ddb1412c4093d7d4aebb (patch)
treeb7ea7af33d75d27d104d736b77d08579635d1f95 /tests
parent349a6ff44c8c6e6560d709975c1521964fd1fc27 (diff)
parent436ce764bada3e8fe3c9d4e7322f38f41e95324c (diff)
downloadQt-4dd54e88efc6899a0024ddb1412c4093d7d4aebb.zip
Qt-4dd54e88efc6899a0024ddb1412c4093d7d4aebb.tar.gz
Qt-4dd54e88efc6899a0024ddb1412c4093d7d4aebb.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: PathView crashed when the path is provided with undefined values. PathView: update modelCount before attempting to regenerate delegates. Update docs - calling overloaded functions from QML is now supported Doc fixes for introduction page and Item docs
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml17
-rw-r--r--tests/auto/declarative/qdeclarativepathview/data/vdm.qml28
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp28
3 files changed, 73 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml b/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml
new file mode 100644
index 0000000..5a647cb
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/undefinedpath.qml
@@ -0,0 +1,17 @@
+import QtQuick 1.0
+
+PathView {
+ id: pathView
+ width: 240; height: 200
+ path: Path {
+ startX: pathView.undef/2.0; startY: 0
+ PathLine { x: pathView.undef/2.0; y: 0 }
+ }
+
+ delegate: Text { text: value }
+ model: ListModel {
+ ListElement { value: "one" }
+ ListElement { value: "two" }
+ ListElement { value: "three" }
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativepathview/data/vdm.qml b/tests/auto/declarative/qdeclarativepathview/data/vdm.qml
new file mode 100644
index 0000000..012db3f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativepathview/data/vdm.qml
@@ -0,0 +1,28 @@
+import QtQuick 1.0
+
+PathView {
+ id: pathView
+ width: 240; height: 320
+
+ pathItemCount: 4
+ preferredHighlightBegin : 0.5
+ preferredHighlightEnd : 0.5
+
+ path: Path {
+ startX: 120; startY: 20;
+ PathLine { x: 120; y: 300 }
+ }
+
+ ListModel {
+ id: mo
+ ListElement { value: "one" }
+ ListElement { value: "two" }
+ ListElement { value: "three" }
+ }
+
+ model: VisualDataModel {
+ delegate: Text { text: model.value }
+ model : mo
+ }
+}
+
diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
index 9193707..bd8baab 100644
--- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
+++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp
@@ -87,6 +87,8 @@ private slots:
void emptyModel();
void closed();
void pathUpdate();
+ void visualDataModel();
+ void undefinedPath();
private:
QDeclarativeView *createView();
@@ -839,6 +841,32 @@ void tst_QDeclarativePathView::pathUpdate()
delete canvas;
}
+void tst_QDeclarativePathView::visualDataModel()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/vdm.qml"));
+
+ QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->count(), 3);
+
+ delete obj;
+}
+
+void tst_QDeclarativePathView::undefinedPath()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/undefinedpath.qml"));
+
+ QDeclarativePathView *obj = qobject_cast<QDeclarativePathView*>(c.create());
+ QVERIFY(obj != 0);
+
+ QCOMPARE(obj->count(), 3);
+
+ delete obj;
+}
+
QDeclarativeView *tst_QDeclarativePathView::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);