QTableWidgetItem

Creates an item for QTableWidget.

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

Example

const { QTableWidget, QMainWindow, QTableWidgetItem } = require("@nodegui/nodegui");
const win = new QMainWindow();
const table = new QTableWidget(2, 3);
table.setHorizontalHeaderLabels(['first', 'second', 'third']);
const cell00 = new QTableWidgetItem('C00');
const cell01 = new QTableWidgetItem('C01');
const cell10 = new QTableWidgetItem('C10');
const cell11 = new QTableWidgetItem('C11');
table.setItem(0, 0, cell00);
table.setItem(0, 1, cell01);
table.setItem(1, 0, cell10);
table.setItem(1, 1, cell11);
win.setCentralWidget(table);
win.show();
(global as any).win = win;

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QTableWidgetItem(): QTableWidgetItem

Overrides Component.constructor

Returns: QTableWidgetItem

+ new QTableWidgetItem(text: string): QTableWidgetItem

Overrides Component.constructor

Parameters:

NameType
textstring

Returns: QTableWidgetItem

Properties

native

native: NativeElement

Overrides Component.native


nodeChildren

nodeChildren: Set‹Component

Inherited from Component.nodeChildren


Optional nodeParent

nodeParent? : Component

Inherited from Component.nodeParent

Methods

setNodeParent

setNodeParent(parent?: Component): void

Inherited from Component.setNodeParent

Parameters:

NameType
parent?Component

Returns: void


setText

setText(text: string): void

Parameters:

NameType
textstring

Returns: void


setTextAlignment

setTextAlignment(alignment: AlignmentFlag): void

Parameters:

NameType
alignmentAlignmentFlag

Returns: void


setToolTip

setToolTip(text: string): void

Parameters:

NameType
textstring

Returns: void


text

text(): string

Returns: string


textAlignment

textAlignment(): AlignmentFlag

Returns: AlignmentFlag


toolTip

toolTip(): string

Returns: string