3 summary:: A view displaying a tree of items with columns
8 A view that displays a hierarchy of items. It is divided into rows and column: each row represents an item, and each column represents a different data field of the items.
10 The items are represented in code by instances of link::Classes/QTreeViewItem::, returned by the various TreeView methods. Top level items are added via the TreeView interface, while child items are added via the QTreeViewItem interface, which also allows to manipulate items in more detail after their creation.
12 Items can be visually sorted with link::#-sort::, or by clicking on one of the column headers, if link::#-canSort:: is enabled.
14 Each item can hold other views in each of its data fields, which allows for rich graphical interaction. See link::Classes/QTreeViewItem#-setView::.
23 PRIVATE:: prForEachColumnDataPair
30 Gets or sets the number of columns (data fields) and their names. When setting a smaller number of columns than the current the extra columns will be removed, and hence all the data stored stored in those columns.
33 An array of Strings for column names.
36 The total number of columns (data fields).
39 Append a new top-level item.
42 An array of Strings (or nil), each for the text of one data field.
44 An instance of QTreeViewItem representing the new item.
47 Insert a new top-level item at code::index::.
50 The position at which to insert the item.
52 An array of Strings (or nil), each for the text of one data field.
54 An instance of QTreeViewItem representing the new item.
57 Remove the given code::item::. After the item is removed, any usage of the related QTreeViewItems will have no effect.
60 An instance of QTreeViewItem.
63 The total number of items.
66 Gets or sets the currently selected item.
69 An instance of QTreeViewItem.
71 An instance of QTreeViewItem or nil, if no current item.
74 The item at code::index::.
78 SUBSECTION:: Appearance
81 Sort items by data in code::column::. This works regardless of link::#-canSort::.
83 NOTE:: Sorting has no effect on the logical order of the items, it only affects how they are displayed. ::
86 The integer column index to sort by.
88 Whether to sort in descending or ascending fashion. The default is ascending.
93 SUBSECTION:: Interaction
96 Whether the user can sort the items by clicking on a column header.
98 When setting to code::true::, the items will be sorted immediately according to the current sorting column. While code::true::, the view will also automatically sort new items.
100 The default is code::false::.
102 See also: link::#-sort::.
109 METHOD:: itemPressedAction
110 The object to be evaluated when a mouse button is pressed on an item, passing this view as the argument.
112 METHOD:: onItemChanged
113 The object to be evaluated whenever the current item changes, passing this view as the argument.