summaryrefslogtreecommitdiff
path: root/src/qml/types
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp61
-rw-r--r--src/qml/types/qqmllistmodel.cpp32
-rw-r--r--src/qml/types/qqmllistmodel_p_p.h7
-rw-r--r--src/qml/types/qqmlobjectmodel.cpp2
4 files changed, 45 insertions, 57 deletions
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index 53b8a3c79d..747c9391e9 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -121,15 +121,16 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent)
/*!
\qmltype VisualDataModel
\instantiates QQmlDelegateModel
- \inqmlmodule QtQml 2
+ \inqmlmodule QtQuick 2
\ingroup qtquick-models
\brief Encapsulates a model and delegate
The VisualDataModel type encapsulates a model and the delegate that will
be instantiated for items in a model.
- This type is provided by \c {QtQuick 2} for compatibility reasons. The same implementation
- is now primarily available as DelegateModel in the QtQml.Models module.
+ This type is provided by the \l{Qt QML} module due to compatibility reasons.
+ The same implementation is now primarily available as DelegateModel in the
+ \l{Qt QML Models QML Types}{Qt QML Models} module.
\sa {QtQml.Models2::DelegateModel}
*/
@@ -142,12 +143,6 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent)
The DelegateModel type encapsulates a model and the delegate that will
be instantiated for items in the model.
- This element is also available as DelegateModel in the \c QtQuick module. For full details,
- see the \l DelegateModel documentation.
-
- The DelegateModel type encapsulates a model and the delegate that will
- be instantiated for items in the model.
-
It is usually not necessary to create a DelegateModel.
However, it can be useful for manipulating and accessing the \l modelIndex
when a QAbstractItemModel subclass is used as the
@@ -158,6 +153,9 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent)
The example below illustrates using a DelegateModel with a ListView.
\snippet delegatemodel/visualdatamodel.qml 0
+
+ \note This type is also available as \l VisualDataModel in the \l{Qt QML}
+ module due to compatibility reasons.
*/
QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt)
@@ -856,7 +854,8 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba
delete cacheItem->object;
cacheItem->object = 0;
cacheItem->scriptRef -= 1;
- cacheItem->contextData->destroy();
+ if (cacheItem->contextData)
+ cacheItem->contextData->destroy();
cacheItem->contextData = 0;
if (!cacheItem->isReferenced()) {
@@ -2169,14 +2168,31 @@ void QQmlDelegateModelGroupPrivate::destroyingPackage(QQuickPackage *package)
}
/*!
+ \qmltype VisualDataGroup
+ \instantiates QQmlDelegateModelGroup
+ \inqmlmodule QtQuick 2
+ \ingroup qtquick-models
+ \brief Encapsulates a filtered set of visual data items
+
+ The VisualDataGroup type provides a means to address the model data of a
+ model's delegate items, as well as sort and filter these delegate items.
+
+ This type is provided by the \l{Qt QML} module due to compatibility reasons.
+ The same implementation is now primarily available as \l DelegateModelGroup
+ in the \l{Qt QML Models QML Types}{Qt QML Models} module.
+
+ \sa {QtQml.Models2::DelegateModelGroup}
+*/
+/*!
\qmltype DelegateModelGroup
\instantiates QQmlDelegateModelGroup
- \inqmlmodule QtQml 2
+ \inqmlmodule QtQml.Models 2
\ingroup qtquick-models
\brief Encapsulates a filtered set of visual data items
- The DelegateModelGroup type provides a means to address the model data of a DelegateModel's
- delegate items, as well as sort and filter these delegate items.
+ The DelegateModelGroup type provides a means to address the model data of a
+ DelegateModel's delegate items, as well as sort and filter these delegate
+ items.
The initial set of instantiable delegate items in a DelegateModel is represented
by its \l {QtQml.Models2::DelegateModel::items}{items} group, which normally directly reflects
@@ -2200,24 +2216,11 @@ void QQmlDelegateModelGroupPrivate::destroyingPackage(QQuickPackage *package)
type or to cherry-pick specific items that should be instantiated irregardless of whether
they're currently within a view's visible area.
- \sa {QML Dynamic View Ordering Tutorial}
-*/
-/*!
- \qmltype DelegateModelGroup
- \instantiates QQmlDelegateModelGroup
- \inqmlmodule QtQml.Models 2
- \brief Encapsulates a filtered set of visual data items
-
- The DelegateModelGroup type provides a means to address the model data of a DelegateModel's
- delegate items, as well as sort and filter these delegate items.
-
- This element is also available as DelegateModelGroup in the \c QtQuick module. For full details,
- see the \l DelegateModelGroup documentation.
+ \note This type is also available as \l VisualDataGroup in the \l{Qt QML}
+ module due to compatibility reasons.
- \sa {QtQuick::DelegateModelGroup}
+ \sa {QML Dynamic View Ordering Tutorial}
*/
-
-
QQmlDelegateModelGroup::QQmlDelegateModelGroup(QObject *parent)
: QObject(*new QQmlDelegateModelGroupPrivate, parent)
{
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 9277b6ea8f..0cfd9c6ccb 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -1426,22 +1426,12 @@ QQmlListModelParser::ListInstruction *QQmlListModelParser::ListModelData::instru
\qmltype ListModel
\instantiates QQmlListModel
\inqmlmodule QtQml.Models 2
- \brief Defines a free-form list data source
-
- The ListModel is a simple container of ListElement definitions, each containing data roles.
- The contents can be defined dynamically, or explicitly in QML.
-
- This type is also available in the \c {QtQuick 2} import. For full documentation, see \l QtQuick2::ListModel
-*/
-/*!
- \qmltype ListModel
- \instantiates QQmlListModel
- \inqmlmodule QtQml 2
- \brief Defines a free-form list data source
\ingroup qtquick-models
+ \brief Defines a free-form list data source
- The ListModel is a simple container of ListElement definitions, each containing data roles.
- The contents can be defined dynamically, or explicitly in QML.
+ The ListModel is a simple container of ListElement definitions, each
+ containing data roles. The contents can be defined dynamically, or
+ explicitly in QML.
The number of elements in the model can be obtained from its \l count property.
A number of familiar methods are also provided to manipulate the contents of the
@@ -1801,7 +1791,7 @@ QHash<int, QByteArray> QQmlListModel::roleNames() const
}
/*!
- \qmlproperty bool QtQml2::ListModel::dynamicRoles
+ \qmlproperty bool ListModel::dynamicRoles
By default, the type of a role is fixed the first time
the role is used. For example, if you create a role called
@@ -1847,7 +1837,7 @@ void QQmlListModel::setDynamicRoles(bool enableDynamicRoles)
}
/*!
- \qmlproperty int QtQml2::ListModel::count
+ \qmlproperty int ListModel::count
The number of data entries in the model.
*/
int QQmlListModel::count() const
@@ -2537,16 +2527,6 @@ bool QQmlListModelParser::definesEmptyList(const QString &s)
\instantiates QQmlListElement
\inqmlmodule QtQml.Models 2
\brief Defines a data item in a ListModel
-
- List elements are defined inside ListModel definitions, and represent items in a list.
-
- This type is also available in the \c {QtQuick 2} import. For full documentation, see \l QtQuick2::ListElement
-*/
-/*!
- \qmltype ListElement
- \instantiates QQmlListElement
- \inqmlmodule QtQml 2
- \brief Defines a data item in a ListModel
\ingroup qtquick-models
List elements are defined inside ListModel definitions, and represent items in a
diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h
index 0190081320..44c349fbe6 100644
--- a/src/qml/types/qqmllistmodel_p_p.h
+++ b/src/qml/types/qqmllistmodel_p_p.h
@@ -229,6 +229,9 @@ private:
QStringHash<Role *> roleHash;
};
+/*!
+\internal
+*/
class ListElement
{
public:
@@ -292,6 +295,9 @@ private:
friend class ListModel;
};
+/*!
+\internal
+*/
class ListModel
{
public:
@@ -375,4 +381,3 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(ListModel *);
#endif // QQUICKLISTMODEL_P_P_H
-
diff --git a/src/qml/types/qqmlobjectmodel.cpp b/src/qml/types/qqmlobjectmodel.cpp
index 3e8a67a7d2..f2a7477c1b 100644
--- a/src/qml/types/qqmlobjectmodel.cpp
+++ b/src/qml/types/qqmlobjectmodel.cpp
@@ -169,7 +169,7 @@ public:
/*!
\qmltype VisualItemModel
\instantiates QQmlObjectModel
- \inqmlmodule QtQml 2
+ \inqmlmodule QtQuick 2
\brief Defines a set of objects to be used as a model
The VisualItemModel type encapsulates contains the objects to be used