website/docs/api/generated/classes/qbrush.md
The QBrush class defines the fill pattern of shapes drawn by QPainter.
This class is a JS wrapper around Qt's QBrush class
const { QBrush } = require("@nodegui/nodegui");
const brush = new QBrush();
↳ QBrush
+ 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
• native: NativeElement | null
Inherited from Component.native
▸ color(): QColor
Returns: QColor
▸ isOpaque(): boolean
Returns: boolean
▸ setColor(color: QColor | GlobalColor): void
Parameters:
| Name | Type |
|---|---|
color | QColor | GlobalColor |
Returns: void
▸ setStyle(style: BrushStyle): void
Parameters:
| Name | Type |
|---|---|
style | BrushStyle |
Returns: void
▸ setTexture(pixmap: QPixmap): void
Parameters:
| Name | Type |
|---|---|
pixmap | QPixmap |
Returns: void
▸ style(): BrushStyle
Returns: BrushStyle
▸ texture(): QPixmap
Returns: QPixmap
Static fromQVariant▸ fromQVariant(variant: QVariant): QBrush
Parameters:
| Name | Type |
|---|---|
variant | QVariant |
Returns: QBrush