QIcon

The QIcon class provides scalable icons in different modes and states.

This class is a JS wrapper around Qt's QIcon class

Example

const { QIcon } = require("@nodegui/nodegui");
const imageUrl = "path/to/png";
const icon = new QIcon(imageUrl);

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QIcon(): QIcon

Overrides Component.constructor

Returns: QIcon

+ new QIcon(native: NativeElement): QIcon

Overrides Component.constructor

Parameters:

NameType
nativeNativeElement

Returns: QIcon

+ new QIcon(filePath: string): QIcon

Overrides Component.constructor

Parameters:

NameType
filePathstring

Returns: QIcon

Properties

native

native: NativeElement

Overrides Component.native


nodeChildren

nodeChildren: Set‹Component

Inherited from Component.nodeChildren


Optional nodeParent

nodeParent? : Component

Inherited from Component.nodeParent

Methods

cacheKey

cacheKey(): number

Returns: number


isMask

isMask(): boolean

Returns: boolean


pixmap

pixmap(width: number, height: number, mode?: QIconMode, state?: QIconState): QPixmap

Parameters:

NameType
widthnumber
heightnumber
mode?QIconMode
state?QIconState

Returns: QPixmap


setIsMask

setIsMask(isMask: boolean): void

Parameters:

NameType
isMaskboolean

Returns: void


setNodeParent

setNodeParent(parent?: Component): void

Inherited from Component.setNodeParent

Parameters:

NameType
parent?Component

Returns: void


Static fromQVariant

fromQVariant(variant: QVariant): QIcon

Parameters:

NameType
variantQVariant

Returns: QIcon