QIcon
The QIcon class provides scalable icons in different modes and states.
This class is a JS wrapper around Qt's QIcon class
Example
Hierarchy
↳ QIcon
Index
Constructors
Properties
Methods
- actualSize
- addFile
- addPixmap
- availableSizes
- cacheKey
- isMask
- isNull
- name
- paint
- pixmap
- setIsMask
- swap
- fromQVariant
Constructors
constructor
+ new QIcon(): QIcon
Overrides Component.constructor
Returns: QIcon
+ new QIcon(native
: NativeElement): QIcon
Overrides Component.constructor
Parameters:
Name | Type |
---|---|
native | NativeElement |
Returns: QIcon
+ new QIcon(filePath
: string): QIcon
Overrides Component.constructor
Parameters:
Name | Type |
---|---|
filePath | string |
Returns: QIcon
+ new QIcon(pixmap
: QPixmap): QIcon
Overrides Component.constructor
Parameters:
Name | Type |
---|---|
pixmap | QPixmap |
Returns: QIcon
Properties
native
• native: NativeElement | null
Inherited from Component.native
Methods
actualSize
â–¸ actualSize(size
: QSize, mode
: QIconMode, state
: QIconState): QSize
Parameters:
Name | Type | Default |
---|---|---|
size | QSize | null |
mode | QIconMode | QIconMode.Normal |
state | QIconState | QIconState.Off |
Returns: QSize
addFile
â–¸ addFile(fileName
: string, size
: QSize, mode
: QIconMode, state
: QIconState): void
Parameters:
Name | Type | Default |
---|---|---|
fileName | string | - |
size | QSize | null |
mode | QIconMode | QIconMode.Normal |
state | QIconState | QIconState.Off |
Returns: void
addPixmap
â–¸ addPixmap(pixmap
: QPixmap, mode
: QIconMode, state
: QIconState): void
Parameters:
Name | Type | Default |
---|---|---|
pixmap | QPixmap | - |
mode | QIconMode | QIconMode.Normal |
state | QIconState | QIconState.Off |
Returns: void
availableSizes
â–¸ availableSizes(mode
: QIconMode, state
: QIconState): QSize[]
Parameters:
Name | Type | Default |
---|---|---|
mode | QIconMode | QIconMode.Normal |
state | QIconState | QIconState.Off |
Returns: QSize[]
cacheKey
â–¸ cacheKey(): number
Returns: number
isMask
â–¸ isMask(): boolean
Returns: boolean
isNull
â–¸ isNull(): boolean
Returns: boolean
name
â–¸ name(): string
Returns: string
paint
â–¸ paint(painter
: QPainter, x
: number, y
: number, w
: number, h
: number, alignment
: AlignmentFlag, mode
: QIconMode, state
: QIconState): void
Parameters:
Name | Type | Default |
---|---|---|
painter | QPainter | - |
x | number | - |
y | number | - |
w | number | - |
h | number | - |
alignment | AlignmentFlag | AlignmentFlag.AlignCenter |
mode | QIconMode | QIconMode.Normal |
state | QIconState | QIconState.Off |
Returns: void
pixmap
â–¸ pixmap(width
: number, height
: number, mode
: QIconMode, state
: QIconState): QPixmap
Parameters:
Name | Type | Default |
---|---|---|
width | number | - |
height | number | - |
mode | QIconMode | QIconMode.Normal |
state | QIconState | QIconState.Off |
Returns: QPixmap
setIsMask
â–¸ setIsMask(isMask
: boolean): void
Parameters:
Name | Type |
---|---|
isMask | boolean |
Returns: void
swap
â–¸ swap(other
: QIcon): void
Parameters:
Name | Type |
---|---|
other | QIcon |
Returns: void
Static
fromQVariant
â–¸ fromQVariant(variant
: QVariant): QIcon
Parameters:
Name | Type |
---|---|
variant | QVariant |
Returns: QIcon