diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-19 10:06:55 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-19 10:10:24 (GMT) |
commit | 83525ca84ba7adadaeeb65ffa55a6d0f2630caaa (patch) | |
tree | 83a26fc42ba3811baf38776d266d4bf600684715 /tests/auto/declarative/qdeclarativevisualdatamodel | |
parent | b115770cc3bba68740a6848c7ccaed932399aca9 (diff) | |
parent | 4082e4711a1c54947429b15504caf778c6da22d0 (diff) | |
download | Qt-83525ca84ba7adadaeeb65ffa55a6d0f2630caaa.zip Qt-83525ca84ba7adadaeeb65ffa55a6d0f2630caaa.tar.gz Qt-83525ca84ba7adadaeeb65ffa55a6d0f2630caaa.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
qmake/generators/win32/msbuild_objectmodel.cpp
src/gui/kernel/qgesturemanager.cpp
tools/qdoc3/test/qt-build-docs.qdocconf
tools/qdoc3/test/qt.qdocconf
Changes in qmake/generators/win32/msvc_objectmodel.cpp come
from commit 4ba3dadcae97bfde6216c32cfa339f8f0e0253c7
Diffstat (limited to 'tests/auto/declarative/qdeclarativevisualdatamodel')
-rw-r--r-- | tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp index 0aad099..29a065c 100644 --- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp @@ -121,6 +121,7 @@ private slots: void objectListModel(); void singleRole(); void modelProperties(); + void noDelegate(); private: QDeclarativeEngine engine; @@ -472,6 +473,29 @@ void tst_qdeclarativevisualdatamodel::modelProperties() //### should also test QStringList and QVariantList } +void tst_qdeclarativevisualdatamodel::noDelegate() +{ + QDeclarativeView view; + + QStandardItemModel model; + initStandardTreeModel(&model); + + view.rootContext()->setContextProperty("myModel", &model); + + view.setSource(QUrl::fromLocalFile(SRCDIR "/data/datalist.qml")); + + QDeclarativeListView *listview = qobject_cast<QDeclarativeListView*>(view.rootObject()); + QVERIFY(listview != 0); + + QDeclarativeVisualDataModel *vdm = listview->findChild<QDeclarativeVisualDataModel*>("visualModel"); + QVERIFY(vdm != 0); + QCOMPARE(vdm->count(), 3); + + vdm->setDelegate(0); + QCOMPARE(vdm->count(), 0); +} + + template<typename T> T *tst_qdeclarativevisualdatamodel::findItem(QGraphicsObject *parent, const QString &objectName, int index) { |