QTreeWidgetItem

Creates an item for QTreeWidget.

This class is a JS wrapper around Qt's QTreeWidgetItem class

Example

const { QMainWindow, QTreeWidgetItem, QTreeWidget } = require("@nodegui/nodegui");
const win = new QMainWindow();
const tree = new QTreeWidget();
const item1 = new QTreeWidgetItem();
item1.setText(0, `item-1`);
const item2 = new QTreeWidgetItem();
item2.setText(0, `item-2`);
const item3 = new QTreeWidgetItem();
item3.setText(0, `item-3`);
tree.addTopLevelItem(item1);
tree.addTopLevelItem(item2);
tree.addTopLevelItem(item3);
// Add children to item1
const c1item1 = new QTreeWidgetItem(item1);
c1item1.setText(0, `c1item1`);
const c1item2 = new QTreeWidgetItem(item1);
c1item2.setText(0, `c1item1`);
win.setCentralWidget(tree);
win.show();
(global as any).win = win;

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QTreeWidgetItem(): QTreeWidgetItem

Overrides Component.constructor

Returns: QTreeWidgetItem

+ new QTreeWidgetItem(parent: QTreeWidgetItem, strings?: string[]): QTreeWidgetItem

Overrides Component.constructor

Parameters:

NameType
parentQTreeWidgetItem
strings?string[]

Returns: QTreeWidgetItem

+ new QTreeWidgetItem(parent: QTreeWidget, strings?: string[]): QTreeWidgetItem

Overrides Component.constructor

Parameters:

NameType
parentQTreeWidget
strings?string[]

Returns: QTreeWidgetItem

+ new QTreeWidgetItem(native: NativeElement): QTreeWidgetItem

Overrides Component.constructor

Parameters:

NameType
nativeNativeElement

Returns: QTreeWidgetItem

+ new QTreeWidgetItem(strings: string[]): QTreeWidgetItem

Overrides Component.constructor

Parameters:

NameType
stringsstring[]

Returns: QTreeWidgetItem

Properties

native

native: NativeElement

Overrides Component.native


nodeChildren

nodeChildren: Set‹Component

Inherited from Component.nodeChildren


Optional nodeParent

nodeParent? : Component

Inherited from Component.nodeParent

Methods

child

child(index: number): QTreeWidgetItem | undefined

Parameters:

NameType
indexnumber

Returns: QTreeWidgetItem | undefined


childCount

childCount(): number

Returns: number


parent

parent(): QTreeWidgetItem | undefined

Returns: QTreeWidgetItem | undefined


setExpanded

setExpanded(expanded: boolean): void

Parameters:

NameType
expandedboolean

Returns: void


setNodeParent

setNodeParent(parent?: Component): void

Inherited from Component.setNodeParent

Parameters:

NameType
parent?Component

Returns: void


setSelected

setSelected(selected: boolean): void

Parameters:

NameType
selectedboolean

Returns: void


setText

setText(column: number, text: string): void

Parameters:

NameType
columnnumber
textstring

Returns: void


text

text(column: number): string

Parameters:

NameType
columnnumber

Returns: string