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

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QListWidgetItem(arg?: QListWidgetItem | NativeElement | string): QListWidgetItem

Overrides Component.constructor

Parameters:

NameType
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:

NameType
rolenumber

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:

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


setHidden

â–¸ setHidden(hide: boolean): void

Parameters:

NameType
hideboolean

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: number): void

Parameters:

NameType
alignmentnumber

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(): number

Returns: number


toolTip

â–¸ toolTip(): string

Returns: string


type

â–¸ type(): number

Returns: number


whatsThis

â–¸ whatsThis(): string

Returns: string