Skip to main content

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