QListWidgetItem
Creates an item for QListWidget.
This class is a JS wrapper around Qt's QListWidgetItem class
Example
const { QListWidget, QListWidgetItem } = require("@nodegui/nodegui");
const listWidget = new QListWidget();
for (let i = 0; i < 30; i++) {
let listWidgetItem = new QListWidgetItem();
listWidgetItem.setText('listWidgetItem ' + i);
if (i===3) {
listWidgetItem.setCheckState(2);
} else {
listWidgetItem.setCheckState(0);
}
listWidget.addItem(listWidgetItem);
}
Hierarchy
-
↳ QListWidgetItem
Index
Constructors
Properties
Methods
- background
- checkState
- data
- flags
- font
- foreground
- icon
- isHidden
- isSelected
- setBackground
- setCheckState
- setData
- setFlags
- setFont
- setForeground
- setHidden
- setIcon
- setSelected
- setSizeHint
- setStatusTip
- setText
- setTextAlignment
- setToolTip
- setWhatsThis
- sizeHint
- statusTip
- text
- textAlignment
- toolTip
- type
- whatsThis
Constructors
constructor
+ new QListWidgetItem(arg?
: QListWidgetItem | NativeElement | string): QListWidgetItem
Overrides Component.constructor
Parameters:
Name | Type |
---|---|
arg? | QListWidgetItem | NativeElement | string |
Returns: QListWidgetItem
Properties
native
• native: NativeElement | null
Inherited from Component.native
Methods
background
▸ background(): QBrush
Returns: QBrush
checkState
▸ checkState(): CheckState
Returns: CheckState
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
isHidden
▸ isHidden(): boolean
Returns: boolean
isSelected
▸ isSelected(): boolean
Returns: boolean
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
setHidden
▸ setHidden(hide
: boolean): void
Parameters:
Name | Type |
---|---|
hide | boolean |
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
: number): void
Parameters:
Name | Type |
---|---|
alignment | number |
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(): number
Returns: number
toolTip
▸ toolTip(): string
Returns: string
type
▸ type(): number
Returns: number
whatsThis
▸ whatsThis(): string
Returns: string