diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-10-06 03:37:26 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-10-06 03:37:26 (GMT) |
commit | 44ad2433eae7dce70a797aa1f7055058a2558a74 (patch) | |
tree | ea44b00c0ba4f4226fc26b90b487b2839ad24f80 /src/declarative | |
parent | 231745acfc4b106d889b139d208563df190db264 (diff) | |
download | Qt-44ad2433eae7dce70a797aa1f7055058a2558a74.zip Qt-44ad2433eae7dce70a797aa1f7055058a2558a74.tar.gz Qt-44ad2433eae7dce70a797aa1f7055058a2558a74.tar.bz2 |
Some docs on data models.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/fx/qfxgridview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxlistview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxpathview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxrepeater.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxvisualitemmodel.cpp | 6 | ||||
-rw-r--r-- | src/declarative/util/qmllistaccessor.cpp | 2 |
6 files changed, 13 insertions, 3 deletions
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp index 3bfc799..9aa1198 100644 --- a/src/declarative/fx/qfxgridview.cpp +++ b/src/declarative/fx/qfxgridview.cpp @@ -710,6 +710,8 @@ QFxGridView::~QFxGridView() for the view. For large or dynamic datasets the model is usually provided by a C++ model object. The C++ model object must be a \l {QAbstractItemModel} subclass, a VisualModel, or a simple list. + + \sa {qmlmodels}{Data Models} */ QVariant QFxGridView::model() const { diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index 71fa2ea..501b4df 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -876,6 +876,8 @@ QFxListView::~QFxListView() Models can also be created directly in QML, using a \l{ListModel}, \l{XmlListModel} or \l{VisualItemModel}. + + \sa {qmlmodels}{Data Models} */ QVariant QFxListView::model() const { diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index 86bc9a2..b127f39 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -140,6 +140,8 @@ QFxPathView::~QFxPathView() The model provides a set of data that is used to create the items for the view. For large or dynamic datasets the model is usually provided by a C++ model object. Models can also be created directly in XML, using the ListModel element. + + \sa {qmlmodels}{Data Models} */ QVariant QFxPathView::model() const { diff --git a/src/declarative/fx/qfxrepeater.cpp b/src/declarative/fx/qfxrepeater.cpp index 063bd1f..182dcc7 100644 --- a/src/declarative/fx/qfxrepeater.cpp +++ b/src/declarative/fx/qfxrepeater.cpp @@ -143,6 +143,8 @@ QFxRepeater::~QFxRepeater() based on the order they are created. Models can also be created directly in QML, using a \l{ListModel} or \l{XmlListModel}. + + \sa {qmlmodels}{Data Models} */ QVariant QFxRepeater::model() const { diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp index 45166de..fb1cfcf 100644 --- a/src/declarative/fx/qfxvisualitemmodel.cpp +++ b/src/declarative/fx/qfxvisualitemmodel.cpp @@ -132,7 +132,11 @@ public: \brief The VisualItemModel allows items to be provided to a view. The children of the VisualItemModel are provided in a model which - can be used in a view. An item can determine its index within the + can be used in a view. Note that no delegate should be + provided to a view since the VisualItemModel contains the + visual delegate (items). + + An item can determine its index within the model via the VisualItemModel.index attached property. The example below places three colored rectangles in a ListView. diff --git a/src/declarative/util/qmllistaccessor.cpp b/src/declarative/util/qmllistaccessor.cpp index ef21ebf..578646b 100644 --- a/src/declarative/util/qmllistaccessor.cpp +++ b/src/declarative/util/qmllistaccessor.cpp @@ -76,7 +76,6 @@ void QmlListAccessor::setList(const QVariant &v, QmlEngine *engine) } else if (d.type() == QMetaType::QVariantList) { m_type = VariantList; } else if (d.canConvert(QVariant::Int)) { - qDebug() << "integer"; m_type = Integer; } else if (d.type() != QVariant::UserType) { m_type = Instance; @@ -90,7 +89,6 @@ void QmlListAccessor::setList(const QVariant &v, QmlEngine *engine) (enginePrivate && enginePrivate->isQmlList(d.userType()))) { m_type = QmlList; } else if (QmlMetaType::isList(d.userType())) { - qDebug() << "list"; m_type = QList; } else { m_type = Invalid; |