QQuickTreeViewDelegate: add edit delegate docs

Add some extra docs to inform that TreeViewDelegate
can edit nodes in the tree.

Change-Id: Iea10f6e1ca3d4bf77ca6df9a753d9c04129a82c8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit is contained in:
Richard Moe Gustavsen 2022-12-09 12:34:36 +01:00
parent 7ece46aa1d
commit 74634a9317
1 changed files with 17 additions and 0 deletions

View File

@ -101,6 +101,23 @@ QT_BEGIN_NAMESPACE
user clicks on the delegate (like changing the current index), you can set
\l {QQuickTableView::pointerNavigationEnabled}{pointerNavigationEnabled} to \c false.
\section2 Editing nodes in the tree
TreeViewDelegate has a default \l {TableView::editDelegate}{edit delegate}
assigned. If \l TreeView has \l {TableView::editTriggers}{edit triggers}
set, and the \l {TableView::model}{model} has support for
\l {Editing cells} {editing model items}, then the user can activate any of
the edit triggers to edit the text of the \l {TableView::current}{current}
tree node.
The default edit delegate will try to use the \c {Qt.EditRole} to read and
write data to the \l {TableView::model}{model}.
If \l QAbstractItemModel::data() returns an empty string for this role, then
\c {Qt.DisplayRole} will be used instead.
You can always assign your own custom edit delegate to
\l {TableView::editDelegate}{TableView.editDelegate} if you have needs
outside what the default edit delegate offers.
\sa TreeView
*/