QPainterPath
Lets you paint paths on widgets.
This class is a JS wrapper around Qt's QPainterPath class
Hierarchy
-
↳ QPainterPath
Index
Constructors
Properties
Methods
- addEllipse
- addPath
- addRect
- addRoundedRect
- addText
- angleAtPercent
- arcMoveTo
- arcTo
- boundingRect
- capacity
- clear
- closeSubpath
- connectPath
- controlPointRect
- cubicTo
- currentPosition
- elementCount
- fillRule
- intersects
- isEmpty
- length
- lineTo
- moveTo
- percentAtLength
- pointAtPercent
- quadTo
- reserve
- setElementPositionAt
- setFillRule
- slopeAtPercent
- swap
- translate
Constructors
constructor
+ new QPainterPath(): QPainterPath
Overrides Component.constructor
Returns: QPainterPath
Properties
native
• native: NativeElement | null
Inherited from Component.native
Methods
addEllipse
▸ addEllipse(x
: number, y
: number, width
: number, height
: number): void
Parameters:
Name | Type |
---|---|
x | number |
y | number |
width | number |
height | number |
Returns: void
addPath
▸ addPath(path
: QPainterPath): void
Parameters:
Name | Type |
---|---|
path | QPainterPath |
Returns: void
addRect
▸ addRect(x
: number, y
: number, width
: number, height
: number): void
Parameters:
Name | Type |
---|---|
x | number |
y | number |
width | number |
height | number |
Returns: void
addRoundedRect
▸ addRoundedRect(x
: number, y
: number, width
: number, height
: number, xRadius
: number, yRadius
: number, mode
: SizeMode): void
Parameters:
Name | Type | Default |
---|---|---|
x | number | - |
y | number | - |
width | number | - |
height | number | - |
xRadius | number | - |
yRadius | number | - |
mode | SizeMode | SizeMode.AbsoluteSize |
Returns: void
addText
▸ addText(x
: number, y
: number, font
: QFont, text
: string): void
Parameters:
Name | Type |
---|---|
x | number |
y | number |
font | QFont |
text | string |
Returns: void
angleAtPercent
▸ angleAtPercent(t
: number): number
Parameters:
Name | Type |
---|---|
t | number |
Returns: number
arcMoveTo
▸ arcMoveTo(x
: number, y
: number, width
: number, height
: number, angle
: number): void
Parameters:
Name | Type |
---|---|
x | number |
y | number |
width | number |
height | number |
angle | number |
Returns: void
arcTo
▸ arcTo(x
: number, y
: number, width
: number, height
: number, startAngle
: number, sweepLength
: number): void
Parameters:
Name | Type |
---|---|
x | number |
y | number |
width | number |
height | number |
startAngle | number |
sweepLength | number |
Returns: void
boundingRect
▸ boundingRect(): object
Returns: object
-
height: number
-
width: number
-
x: number
-
y: number
capacity
▸ capacity(): number
Returns: number
clear
▸ clear(): void
Returns: void
closeSubpath
▸ closeSubpath(): void
Returns: void
connectPath
▸ connectPath(path
: QPainterPath): void
Parameters:
Name | Type |
---|---|
path | QPainterPath |
Returns: void
controlPointRect
▸ controlPointRect(): object
Returns: object
-
height: number
-
width: number
-
x: number
-
y: number
cubicTo
▸ cubicTo(c1X
: number, c1Y
: number, c2X
: number, c2Y
: number, endPointX
: number, endPointY
: number): boolean
Parameters:
Name | Type |
---|---|
c1X | number |
c1Y | number |
c2X | number |
c2Y | number |
endPointX | number |
endPointY | number |
Returns: boolean
currentPosition
▸ currentPosition(): object
Returns: object
-
x: number
-
y: number
elementCount
▸ elementCount(): number
Returns: number
fillRule
▸ fillRule(): FillRule
Returns: FillRule
intersects
▸ intersects(path
: QPainterPath): boolean
Parameters:
Name | Type |
---|---|
path | QPainterPath |
Returns: boolean
isEmpty
▸ isEmpty(): boolean
Returns: boolean
length
▸ length(): number
Returns: number
lineTo
▸ lineTo(x
: number, y
: number): boolean
Parameters:
Name | Type |
---|---|
x | number |
y | number |
Returns: boolean
moveTo
▸ moveTo(x
: number, y
: number): void
Parameters:
Name | Type |
---|---|
x | number |
y | number |
Returns: void
percentAtLength
▸ percentAtLength(len
: number): number
Parameters:
Name | Type |
---|---|
len | number |
Returns: number
pointAtPercent
▸ pointAtPercent(p
: number): object
Parameters:
Name | Type |
---|---|
p | number |
Returns: object
-
x: number
-
y: number
quadTo
▸ quadTo(cx
: number, cy
: number, endPointX
: number, endPointY
: number): boolean
Parameters:
Name | Type |
---|---|
cx | number |
cy | number |
endPointX | number |
endPointY | number |
Returns: boolean
reserve
▸ reserve(size
: number): void
Parameters:
Name | Type |
---|---|
size | number |
Returns: void
setElementPositionAt
▸ setElementPositionAt(index
: number, x
: number, y
: number): void
Parameters:
Name | Type |
---|---|
index | number |
x | number |
y | number |
Returns: void
setFillRule
▸ setFillRule(fillRule
: FillRule): void
Parameters:
Name | Type |
---|---|
fillRule | FillRule |
Returns: void
slopeAtPercent
▸ slopeAtPercent(p
: number): number
Parameters:
Name | Type |
---|---|
p | number |
Returns: number
swap
▸ swap(other
: QPainterPath): void
Parameters:
Name | Type |
---|---|
other | QPainterPath |
Returns: void
translate
▸ translate(x
: number, y
: number): void
Parameters:
Name | Type |
---|---|
x | number |
y | number |
Returns: void