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?: arg): QListWidgetItem

Overrides Component.constructor

Parameters:

NameType
arg?arg

Returns: QListWidgetItem

Properties

native

native: NativeElement

Overrides Component.native


nodeChildren

nodeChildren: Set‹Component

Inherited from Component.nodeChildren


Optional nodeParent

nodeParent? : Component

Inherited from Component.nodeParent

Methods

checkState

checkState(): CheckState

Returns: CheckState


data

data(role: number): QVariant

Parameters:

NameType
rolenumber

Returns: QVariant


flags

flags(): ItemFlag

Returns: ItemFlag


icon

icon(): QIcon

Returns: QIcon


isHidden

isHidden(): boolean

Returns: boolean


isSelected

isSelected(): boolean

Returns: boolean


setCheckState

setCheckState(state: CheckState): void

Parameters:

NameType
stateCheckState

Returns: void


setFlags

setFlags(flags: ItemFlag): void

Parameters:

NameType
flagsItemFlag

Returns: void


setHidden

setHidden(hide: boolean): void

Parameters:

NameType
hideboolean

Returns: void


setIcon

setIcon(icon: QIcon): void

Parameters:

NameType
iconQIcon

Returns: void


setNodeParent

setNodeParent(parent?: Component): void

Inherited from Component.setNodeParent

Parameters:

NameType
parent?Component

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


whatsThis

whatsThis(): string

Returns: string