-Took out members of QtQml.Models submodule from Qt QML and Qt Quick.
-Set up qdocconf files to include QtQml.Models to be part of Qt QML
doc build.
-Edited the sentences to make it clearer that list and model types
are in QtQml.Models.
-Placed the Visual* types back to QtQuick 2 module.
-This patch removes several collision pages.
Change-Id: I16e7045162af6852e5d6c3162b6f4cf97a42402b
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
/*!
\qmlmodule QtQml.Models 2
- \title Qt QML Model QML Types
+ \title Qt QML Models QML Types
\ingroup qmlmodules
\brief Provides QML types for data models
\since 5.1
import QtQml.Models 2.1
\endcode
- Note that QtQml.Models module started at version 2.1 to match the version of the parent module.
+ Note that QtQml.Models module started at version 2.1 to match the version
+ of the parent module, \l{Qt QML}.
*/
depends += qtcore qtxmlpatterns qtgui qtquick qtdoc
-headerdirs += ..
+headerdirs += .. \
+ ../../imports/models
-sourcedirs += ..
+sourcedirs += .. \
+ ../../imports/models
exampledirs += ../../../examples/qml \
../ \
import QtQuick 2.0
\endqml
-See the \l{Qt Quick} module documentation for more information about the
-\c QtQuick namespace and what it provides to QML application developers.
+See the \l{Qt Quick} module documentation for more information about the \c
+QtQuick namespace and what it provides to QML application developers.
+
+The QML types for creating lists and models, such as \l ListModel and \l
+ListElement, are moved to a submodule, \c QtQml.Models. The \l{Qt QML Models QML
+Types}{Qt QML Models} page has more information.
+
The documentation for the types below applies equally to the types of the same
name provided by the \l{Qt Quick} module, as they are in fact identical.
\li \l Timer
\endlist
+\section2 Lists and Models
+
+New in Qt 5.1, the model types are moved to a submodule, \c QtQml.Models. The
+\l{Qt QML Models QML Types}{Qt QML Models} page has more information.
+
+\list
+\li \l DelegateModel
+\li \l DelegateModelGroup
+\li \l ListElement
+\li \l ListModel
+\li \l ObjectModel
+\endlist
+
\section1 JavaScript Environment for QML Applications
JavaScript expressions allow QML code to contain application logic. Qt QML
\li New properties for \l Qt.application: arguments, name, and version.
\endlist
-\section2 New Submodules
+\section2 New Submodule
-The Qt QML Models is a new submodule in Qt 5.1 and provides several QML types
-for handling data with models and lists.
+The \l{Qt QML Models QML Types}{Qt QML Models} is a new submodule in Qt 5.1 and
+provides several QML types for handling data with models and lists. These types
+replace types such as \l VisualItem, \l VisualDataModel, and \l VisualDataGroup.
\list
-\li \l{QtQml.Models}{Models}
+\li \l{Qt QML Models QML Types}{Models}
\endlist
The \l{What's New in Qt 5.1} has more information about the Qt 5.1 release.
/*!
\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}
*/
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
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)
}
/*!
+ \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
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)
{
\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.
-
- \sa {QtQml2::ListModel}{Full documentation for 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
}
/*!
- \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
}
/*!
- \qmlproperty int QtQml2::ListModel::count
+ \qmlproperty int ListModel::count
The number of data entries in the model.
*/
int QQmlListModel::count() const
\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.
-
- \sa {QtQml2::ListElement}{Full documentation for 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
QStringHash<Role *> roleHash;
};
+/*!
+\internal
+*/
class ListElement
{
public:
friend class ListModel;
};
+/*!
+\internal
+*/
class ListModel
{
public:
Q_DECLARE_METATYPE(ListModel *);
#endif // QQUICKLISTMODEL_P_P_H
-
/*!
\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
sourcedirs += ../../plugins
#exclude certain directories
-excludedirs = ../../imports/dialogs
+excludedirs += ../../imports/dialogs \
+ ../../imports/models
\section2 Model/View Types And Data Storage And Access
-Models And Model Data
+QML Lists and Models
+
+The \l{Qt QML Models QML Types}{Qt QML Models} submodule provides the types for
+structuring data with models and lists.
+\list
+\li \l ListModel - Defines a list of data
+\li \l ListElement - Defines a data item in a \l ListModel
+\endlist
+
+These QML types are part of Qt Quick for backwards compatibility, but for
+newer applications, \l{Qt QML Models QML Types}{Qt QML Models} provides
+the same functionality.
\list
-\li \l {QtQml2::ListModel}{ListModel} - Defines a list of data
-\li \l {QtQml2::ListElement}{ListElement} - Defines a data item in a \l {QtQml2::ListModel}{ListModel}
\li \l {VisualItemModel} - Contains items that already defines its own visual delegate
\li \l {VisualDataModel} - Encapsulates a model and a delegate
\li \l {VisualDataGroup} - Encapsulates a filtered set of visual data items
+\endlist
+
+XML Lists
+\list
\li \l {XmlListModel} - Specifies a model using XPath expressions
\li \l {XmlRole} - Specifies a role for an \l {XmlListModel}
\endlist
\li New \l TextEdit properties: selectByKeyboard and textDocument
\li A \l Window declared inside another Window or \l Item will automatically be
transient for (centered upon) the outer window.
+\li These types are now part of \l{Qt QML}:
+ \list
+ \li \l {VisualItemModel}
+ \li \l {VisualDataModel} - Encapsulates a model and a delegate
+ \li \l {VisualDataGroup}
+ \endlist
+ These types are kept due to compatibility reasons and are replaced by the
+ \l{Qt QML Models QML Types}{Qt QML Models} types.
+ \endlist
\endlist
\section2 New Submodules