diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-01-07 12:07:28 +0100 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-02-13 15:27:46 +0000 |
commit | 82c7760b819f73ebc7f4ba6203fa2fc92b383236 (patch) | |
tree | f5ae4743a45c43a4a95115679d3f1690a4a6268e /src/controls/TableViewColumn.qml | |
parent | 6f15c206b069ed0fcf48a285bfcc4ad636927df0 (diff) | |
download | qtquickcontrols-82c7760b819f73ebc7f4ba6203fa2fc92b383236.tar.gz |
Introducing TreeView
The TreeView, as currently implemented, extends the
TableView by adding support for hierarchical models. In
the broad sense, it remains a list view with columns,
like TableView.
The main architecture is based on TreeModelAdaptor, that
wraps the hierarchical model. It keeps track of which
items are expanded or collapsed, and also relays model
changes to the view. (TreeModelAdaptor is a private type
and should be considered as an implementation detail.)
The TreeView only supports QAbstractItemModels for the
time being, and, just like TableView, relies on roles to
pass the data to the view. This also means that model
columns are not supported.
Selection is supported by ItemSelectionModel which exposes
part of the API of QItemSelectionModel. For this, support
has been added for QModelIndex and related classes. This
requires importing QtQml.Models 2.2 should an actual usage
of the TreeView use selection.
In the same way, TreeViewStyle currently extends TableViewStyle
with the relevant features, like branch indicator.
[ChangeLog][QtQuick.Controls] Introducing TreeView
With-Help-From: Caroline Chao <caroline.chao@theqtcompany.com>
Change-Id: Id3dba240a732744571e4a646b7b98678ab522da6
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
Diffstat (limited to 'src/controls/TableViewColumn.qml')
-rw-r--r-- | src/controls/TableViewColumn.qml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/controls/TableViewColumn.qml b/src/controls/TableViewColumn.qml index fc6d6a3d..3ee4bf31 100644 --- a/src/controls/TableViewColumn.qml +++ b/src/controls/TableViewColumn.qml @@ -41,11 +41,11 @@ import QtQuick 2.2 \inqmlmodule QtQuick.Controls \since 5.1 \ingroup viewitems - \brief Used to define columns in a \l TableView. + \brief Used to define columns in a \l TableView or in a \l TreeView. \image tableview.png - TableViewColumn represents a column within a TableView. It provides + TableViewColumn represents a column within a TableView or a TreeView. It provides properties to decide how the data in that column is presented. \qml @@ -56,7 +56,7 @@ import QtQuick 2.2 } \endqml - \sa TableView + \sa TableView, TreeView */ QtObject { @@ -117,7 +117,7 @@ QtObject { property int horizontalAlignment: Text.AlignLeft /*! The delegate of the column. This can be used to set the - \l TableView::itemDelegate for a specific column. + \l TableView::itemDelegate or TreeView::itemDelegate for a specific column. In the delegate you have access to the following special properties: \list |