QBrush
The QBrush class defines the fill pattern of shapes drawn by QPainter.
This class is a JS wrapper around Qt's QBrush class
Example
const { QBrush } = require("@nodegui/nodegui");
const brush = new QBrush();
Hierarchy
-
↳ QBrush
Index
Constructors
Properties
Methods
Constructors
constructor
+ new QBrush(nativeOrGlobalColor?
: NativeElement | GlobalColor | QColor, style
: BrushStyle): QBrush
Overrides Component.constructor
Parameters:
Name | Type | Default |
---|---|---|
nativeOrGlobalColor? | NativeElement | GlobalColor | QColor | - |
style | BrushStyle | BrushStyle.SolidPattern |
Returns: QBrush
Properties
native
• native: NativeElement | null
Inherited from Component.native
Methods
color
▸ color(): QColor
Returns: QColor
isOpaque
▸ isOpaque(): boolean
Returns: boolean
setColor
▸ setColor(color
: QColor | GlobalColor): void
Parameters:
Name | Type |
---|---|
color | QColor | GlobalColor |
Returns: void
setStyle
▸ setStyle(style
: BrushStyle): void
Parameters:
Name | Type |
---|---|
style | BrushStyle |
Returns: void
setTexture
▸ setTexture(pixmap
: QPixmap): void
Parameters:
Name | Type |
---|---|
pixmap | QPixmap |
Returns: void
style
▸ style(): BrushStyle
Returns: BrushStyle
texture
▸ texture(): QPixmap
Returns: QPixmap
Static
fromQVariant
▸ fromQVariant(variant
: QVariant): QBrush
Parameters:
Name | Type |
---|---|
variant | QVariant |
Returns: QBrush