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(other: QTableWidgetItem): QTableWidgetItem

Overrides Component.constructor

Parameters:

NameType
otherQTableWidgetItem

Returns: QTableWidgetItem

+ new QTableWidgetItem(native: NativeElement): QTableWidgetItem

Overrides Component.constructor

Parameters:

NameType
nativeNativeElement

Returns: QTableWidgetItem

+ new QTableWidgetItem(text: string): QTableWidgetItem

Overrides Component.constructor

Parameters:

NameType
textstring

Returns: QTableWidgetItem

Properties

native

• native: NativeElement | null

Inherited from Component.native

Methods

background

â–¸ background(): QBrush

Returns: QBrush


checkState

â–¸ checkState(): CheckState

Returns: CheckState


column

â–¸ column(): number

Returns: number


data

â–¸ data(role: number): QVariant

Parameters:

NameType
rolenumber

Returns: QVariant


flags

â–¸ flags(): ItemFlag

Returns: ItemFlag


font

â–¸ font(): QFont

Returns: QFont


foreground

â–¸ foreground(): QBrush

Returns: QBrush


icon

â–¸ icon(): QIcon

Returns: QIcon


isSelected

â–¸ isSelected(): boolean

Returns: boolean


row

â–¸ row(): number

Returns: number


setBackground

â–¸ setBackground(brush: QBrush): void

Parameters:

NameType
brushQBrush

Returns: void


setCheckState

â–¸ setCheckState(state: CheckState): void

Parameters:

NameType
stateCheckState

Returns: void


setData

â–¸ setData(role: number, value: QVariant): void

Parameters:

NameType
rolenumber
valueQVariant

Returns: void


setFlags

â–¸ setFlags(flags: ItemFlag): void

Parameters:

NameType
flagsItemFlag

Returns: void


setFont

â–¸ setFont(font: QFont): void

Parameters:

NameType
fontQFont

Returns: void


setForeground

â–¸ setForeground(brush: QBrush): void

Parameters:

NameType
brushQBrush

Returns: void


setIcon

â–¸ setIcon(icon: QIcon): void

Parameters:

NameType
iconQIcon

Returns: void


setSelected

â–¸ setSelected(select: boolean): void

Parameters:

NameType
selectboolean

Returns: void


setSizeHint

â–¸ setSizeHint(size: QSize): void

Parameters:

NameType
sizeQSize

Returns: void


setStatusTip

â–¸ setStatusTip(statusTip: string): void

Parameters:

NameType
statusTipstring

Returns: void


setText

â–¸ setText(text: string): void

Parameters:

NameType
textstring

Returns: void


setTextAlignment

â–¸ setTextAlignment(alignment: AlignmentFlag): void

Parameters:

NameType
alignmentAlignmentFlag

Returns: void


setToolTip

â–¸ setToolTip(toolTip: string): void

Parameters:

NameType
toolTipstring

Returns: void


setWhatsThis

â–¸ setWhatsThis(whatsThis: string): void

Parameters:

NameType
whatsThisstring

Returns: void


sizeHint

â–¸ sizeHint(): QSize

Returns: QSize


statusTip

â–¸ statusTip(): string

Returns: string


text

â–¸ text(): string

Returns: string


textAlignment

â–¸ textAlignment(): AlignmentFlag

Returns: AlignmentFlag


toolTip

â–¸ toolTip(): string

Returns: string


type

â–¸ type(): number

Returns: number


whatsThis

â–¸ whatsThis(): string

Returns: string