diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-03-28 10:28:45 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-28 03:10:21 +0200 |
commit | 0ad4550ac0946540f2c76008765d69c62adeed54 (patch) | |
tree | 517b69abfba131acd5669ca78e9fda8d951b6557 | |
parent | 4f08f48017bf4fe17b23bd5d7399bce4bd37d806 (diff) |
Fix imports in GridView test
Were still importing QtQuick 1.0 and not checking whether the
components were created.
Change-Id: Ie42e5d1b3a134af39c62c5eb54a1d620c59cefee
Reviewed-by: Bea Lam <bea.lam@nokia.com>
-rw-r--r-- | tests/auto/quick/qquickgridview/tst_qquickgridview.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp index c7b5ca6b40..22c9004ccc 100644 --- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp +++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp @@ -2094,15 +2094,17 @@ void tst_QQuickGridView::componentChanges() QTRY_VERIFY(gridView); QQmlComponent component(canvas->engine()); - component.setData("import QtQuick 1.0; Rectangle { color: \"blue\"; }", QUrl::fromLocalFile("")); + component.setData("import QtQuick 2.0; Rectangle { color: \"blue\"; }", QUrl::fromLocalFile("")); QQmlComponent delegateComponent(canvas->engine()); - delegateComponent.setData("import QtQuick 1.0; Text { text: '<b>Name:</b> ' + name }", QUrl::fromLocalFile("")); + delegateComponent.setData("import QtQuick 2.0; Text { text: '<b>Name:</b> ' + name }", QUrl::fromLocalFile("")); QSignalSpy highlightSpy(gridView, SIGNAL(highlightChanged())); QSignalSpy delegateSpy(gridView, SIGNAL(delegateChanged())); QSignalSpy headerSpy(gridView, SIGNAL(headerChanged())); QSignalSpy footerSpy(gridView, SIGNAL(footerChanged())); + QSignalSpy headerItemSpy(gridView, SIGNAL(headerItemChanged())); + QSignalSpy footerItemSpy(gridView, SIGNAL(footerItemChanged())); gridView->setHighlight(&component); gridView->setDelegate(&delegateComponent); @@ -2114,10 +2116,15 @@ void tst_QQuickGridView::componentChanges() QTRY_COMPARE(gridView->header(), &component); QTRY_COMPARE(gridView->footer(), &component); + QVERIFY(gridView->headerItem()); + QVERIFY(gridView->footerItem()); + QTRY_COMPARE(highlightSpy.count(),1); QTRY_COMPARE(delegateSpy.count(),1); QTRY_COMPARE(headerSpy.count(),1); QTRY_COMPARE(footerSpy.count(),1); + QTRY_COMPARE(headerItemSpy.count(),1); + QTRY_COMPARE(footerItemSpy.count(),1); gridView->setHighlight(&component); gridView->setDelegate(&delegateComponent); @@ -2128,6 +2135,8 @@ void tst_QQuickGridView::componentChanges() QTRY_COMPARE(delegateSpy.count(),1); QTRY_COMPARE(headerSpy.count(),1); QTRY_COMPARE(footerSpy.count(),1); + QTRY_COMPARE(headerItemSpy.count(),1); + QTRY_COMPARE(footerItemSpy.count(),1); delete canvas; } |