TreeViewItem:
Filter:
Classes | GUI > Views

TreeViewItem : Object

An item in TreeView
Source: QTreeView.sc
Subclasses: QTreeViewItem

Description

An instance of TreeViewItem represents an item in TreeView. There may be multiple instances representing the same item, e.g. after calling TreeView: -currentItem multiple times.

Class Methods

Inherited class methods

Instance Methods

.index

Returns:

An integer position of this item among its siblings.

.parent

Returns:

An new instance of TreeViewItem representing the parent item.

.childAt(index)

Returns:

A new instance of TreeViewItem representing the child item at index.

.addChild(strings)

Appends a new child to this item.

Arguments:

strings

An array of Strings (or nil), each for the text of one data field.

Returns:

An instance of TreeViewItem representing the new item.

.insertChild(index, strings)

Inserts a new child to this item at index.

Arguments:

index

The position at which to insert the child.

strings

An array of Strings (or nil), each for the text of one data field.

Returns:

An instance of TreeViewItem representing the new item.

.strings

.strings = strings

The text in the data fields.

Arguments:

strings

An array of Strings (or nil), each for the text of one data field.

.setString(column, string)

Sets the text in the given data field.

Arguments:

column

An integer index of a data field.

string

A String or nil.

.colors = colors

The background colors of the data fields.

Arguments:

colors

An array of Colors, each for the color of one data field.

.setColor(column, color)

Sets the background color of the given data field.

Arguments:

column

An integer index of a data field.

color

A Color.

.textColors = textColors

The text colors of the data fields.

Arguments:

textColors

An array of Colors, each for the color of one data field.

.setTextColor(column, color)

Sets the text color of the given data field.

Arguments:

column

An integer index of a data field.

color

A Color.

.setView(column, view)

Places another view into the given data field. Only one view can be placed into a data field at once. If a view is already present, it will be removed and destroyed.

If the number of data fields decreases due to a call to TreeView: -columns, the views contained in removed data fields will also be removed and destroyed.

Arguments:

column

An integer index of a data field.

view

A View.

.removeView(column)

Removes the view from the given data field, if any.

Arguments:

column

An integer index of a data field.

.view(column)

The view in the given data field.

Arguments:

column

An integer index of a data field.

==(other)

Implements equality comparison between two TreeViewItem instances. Two instances are equal if they represent the same item in TreeView.

Returns:

A Boolean.

.isNull

Whether the item is invalid. After an item is removed, all related TreeViewItem instances become invalid.

Returns:

A Boolean.

Inherited instance methods

Undocumented instance methods

.id

.treeView

Examples