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

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QBrush(nativeOrGlobalColor?: NativeElement | GlobalColor | QColor, style: BrushStyle): QBrush

Overrides Component.constructor

Parameters:

NameTypeDefault
nativeOrGlobalColor?NativeElement | GlobalColor | QColor-
styleBrushStyleBrushStyle.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:

NameType
colorQColor | GlobalColor

Returns: void


setStyle

â–¸ setStyle(style: BrushStyle): void

Parameters:

NameType
styleBrushStyle

Returns: void


setTexture

â–¸ setTexture(pixmap: QPixmap): void

Parameters:

NameType
pixmapQPixmap

Returns: void


style

â–¸ style(): BrushStyle

Returns: BrushStyle


texture

â–¸ texture(): QPixmap

Returns: QPixmap


Static fromQVariant

â–¸ fromQVariant(variant: QVariant): QBrush

Parameters:

NameType
variantQVariant

Returns: QBrush