summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/pathview
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-08-19 04:22:45 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-08-19 04:22:45 (GMT)
commitb763dee21dc82fa2abb2f9f038a0253e4e8ed848 (patch)
tree1494bb35fec768d499786286d735e5d601a69cd4 /tests/auto/declarative/pathview
parente19fa69859c1abe8da0623c502d012cff214e1c4 (diff)
downloadQt-b763dee21dc82fa2abb2f9f038a0253e4e8ed848.zip
Qt-b763dee21dc82fa2abb2f9f038a0253e4e8ed848.tar.gz
Qt-b763dee21dc82fa2abb2f9f038a0253e4e8ed848.tar.bz2
Update autotests
Not so much that they pass (or even run) of course. Just making the id change that was needed in the layouts test to all the other copy and pasted findItem functions.
Diffstat (limited to 'tests/auto/declarative/pathview')
-rw-r--r--tests/auto/declarative/pathview/data/pathview.qml2
-rw-r--r--tests/auto/declarative/pathview/tst_pathview.cpp18
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/declarative/pathview/data/pathview.qml b/tests/auto/declarative/pathview/data/pathview.qml
index 5bf2085..7040e4c 100644
--- a/tests/auto/declarative/pathview/data/pathview.qml
+++ b/tests/auto/declarative/pathview/data/pathview.qml
@@ -12,7 +12,7 @@ Rect {
height: 20
width: 60
color: "white"
- pen.color: "black"
+ border.color: "black"
Text {
text: index
}
diff --git a/tests/auto/declarative/pathview/tst_pathview.cpp b/tests/auto/declarative/pathview/tst_pathview.cpp
index 92890ba..9cae961 100644
--- a/tests/auto/declarative/pathview/tst_pathview.cpp
+++ b/tests/auto/declarative/pathview/tst_pathview.cpp
@@ -101,7 +101,7 @@ tst_QFxPathView::tst_QFxPathView()
void tst_QFxPathView::items()
{
- QFxView *canvas = createView(SRCDIR "/data/pathview.xml");
+ QFxView *canvas = createView(SRCDIR "/data/pathview.qml");
TestModel model;
model.addItem("Fred", "12345");
@@ -133,7 +133,7 @@ void tst_QFxPathView::items()
void tst_QFxPathView::pathMoved()
{
- QFxView *canvas = createView(SRCDIR "/data/pathview.xml");
+ QFxView *canvas = createView(SRCDIR "/data/pathview.qml");
TestModel model;
model.addItem("Ben", "12345");
@@ -176,7 +176,7 @@ void tst_QFxPathView::pathMoved()
void tst_QFxPathView::limitedItems()
{
- QFxView *canvas = createView(SRCDIR "/data/pathview.xml");
+ QFxView *canvas = createView(SRCDIR "/data/pathview.qml");
TestModel model;
for(int i=0; i<100; i++)
@@ -220,23 +220,23 @@ QFxView *tst_QFxPathView::createView(const QString &filename)
QFile file(filename);
file.open(QFile::ReadOnly);
- QString xml = file.readAll();
- canvas->setQml(xml, filename);
+ QString qml = file.readAll();
+ canvas->setQml(qml, filename);
return canvas;
}
/*
- Find an item with the specified id. If index is supplied then the
+ Find an item with the specified objectName. If index is supplied then the
item must also evaluate the {index} expression equal to index
*/
template<typename T>
-T *tst_QFxPathView::findItem(QFxItem *parent, const QString &id, int index)
+T *tst_QFxPathView::findItem(QFxItem *parent, const QString &objectName, int index)
{
const QMetaObject &mo = T::staticMetaObject;
for (int i = 0; i < parent->children()->count(); ++i) {
QFxItem *item = parent->children()->at(i);
- if (mo.cast(item) && (id.isEmpty() || item->id() == id)) {
+ if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) {
if (index != -1) {
QmlExpression e(qmlContext(item), "index", item);
e.setTrackChange(false);
@@ -246,7 +246,7 @@ T *tst_QFxPathView::findItem(QFxItem *parent, const QString &id, int index)
return static_cast<T*>(item);
}
}
- item = findItem<T>(item, id, index);
+ item = findItem<T>(item, objectName, index);
if (item)
return static_cast<T*>(item);
}