diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-10-13 11:12:06 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-10-18 06:37:24 +0000 |
commit | 5e8483841844e92c0b28e9490bc8f6dea81c9b4a (patch) | |
tree | 431be1181e9566dd30a3507476586c699394fffb | |
parent | 0c241b458d4f5e741728879b39c19b648ccd3281 (diff) |
QtQml.Models: Amend documentation for ListModel
QAbstractListModel has a QML name these days. We can mark the
inheritance. Also, add a note about it to the description.
Fixes: QTBUG-101991
Change-Id: I9db8c399caa48b268b532a6ed88beec9f4032ee1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d9d2af4db3c6851506da68dae6db13f813fa75b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e0091fe5d037e6a461ef9ef76bfbaf0f6cf7ac14)
-rw-r--r-- | src/qmlmodels/qqmllistmodel.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qmlmodels/qqmllistmodel.cpp b/src/qmlmodels/qqmllistmodel.cpp index 3bd180d072..28a2523561 100644 --- a/src/qmlmodels/qqmllistmodel.cpp +++ b/src/qmlmodels/qqmllistmodel.cpp @@ -1916,6 +1916,7 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index) /*! \qmltype ListModel \instantiates QQmlListModel + \inherits AbstractListModel \inqmlmodule QtQml.Models \ingroup qtquick-models \brief Defines a free-form list data source. @@ -1933,6 +1934,10 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index) Elements can be manipulated via the model using the setProperty() method, which allows the roles of the specified element to be set and changed. + ListModel inherits from \l{QAbstractListModel} and provides its \l{Q_INVOKABLE} + methods. You can, for example use \l{QAbstractItemModel::index} to retrieve a + \l{QModelIndex} for a row and column. + \section1 Example Usage The following example shows a ListModel containing three elements, with the roles |