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
-
↳ QTableWidgetItem
Index
Constructors
Properties
Methods
- background
- checkState
- column
- data
- flags
- font
- foreground
- icon
- isSelected
- row
- setBackground
- setCheckState
- setData
- setFlags
- setFont
- setForeground
- setIcon
- setSelected
- setSizeHint
- setStatusTip
- setText
- setTextAlignment
- setToolTip
- setWhatsThis
- sizeHint
- statusTip
- text
- textAlignment
- toolTip
- type
- whatsThis
Constructors
constructor
+ new QTableWidgetItem(): QTableWidgetItem
Overrides Component.constructor
Returns: QTableWidgetItem
+ new QTableWidgetItem(other
: QTableWidgetItem): QTableWidgetItem
Overrides Component.constructor
Parameters:
Name | Type |
---|---|
other | QTableWidgetItem |
Returns: QTableWidgetItem
+ new QTableWidgetItem(native
: NativeElement): QTableWidgetItem
Overrides Component.constructor
Parameters:
Name | Type |
---|---|
native | NativeElement |
Returns: QTableWidgetItem
+ new QTableWidgetItem(text
: string): QTableWidgetItem
Overrides Component.constructor
Parameters:
Name | Type |
---|---|
text | string |
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:
Name | Type |
---|---|
role | number |
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:
Name | Type |
---|---|
brush | QBrush |
Returns: void
setCheckState
▸ setCheckState(state
: CheckState): void
Parameters:
Name | Type |
---|---|
state | CheckState |
Returns: void
setData
▸ setData(role
: number, value
: QVariant): void
Parameters:
Name | Type |
---|---|
role | number |
value | QVariant |
Returns: void
setFlags
▸ setFlags(flags
: ItemFlag): void
Parameters:
Name | Type |
---|---|
flags | ItemFlag |
Returns: void
setFont
▸ setFont(font
: QFont): void
Parameters:
Name | Type |
---|---|
font | QFont |
Returns: void
setForeground
▸ setForeground(brush
: QBrush): void
Parameters:
Name | Type |
---|---|
brush | QBrush |
Returns: void
setIcon
▸ setIcon(icon
: QIcon): void
Parameters:
Name | Type |
---|---|
icon | QIcon |
Returns: void
setSelected
▸ setSelected(select
: boolean): void
Parameters:
Name | Type |
---|---|
select | boolean |
Returns: void
setSizeHint
▸ setSizeHint(size
: QSize): void
Parameters:
Name | Type |
---|---|
size | QSize |
Returns: void
setStatusTip
▸ setStatusTip(statusTip
: string): void
Parameters:
Name | Type |
---|---|
statusTip | string |
Returns: void
setText
▸ setText(text
: string): void
Parameters:
Name | Type |
---|---|
text | string |
Returns: void
setTextAlignment
▸ setTextAlignment(alignment
: AlignmentFlag): void
Parameters:
Name | Type |
---|---|
alignment | AlignmentFlag |
Returns: void
setToolTip
▸ setToolTip(toolTip
: string): void
Parameters:
Name | Type |
---|---|
toolTip | string |
Returns: void
setWhatsThis
▸ setWhatsThis(whatsThis
: string): void
Parameters:
Name | Type |
---|---|
whatsThis | string |
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