website/docs/api/generated/classes/qpointf.md
The QPointF class defines a point in the plane using floating point precision
A point is specified by a x coordinate and an y coordinate which can be accessed using the x() and y() functions. The coordinates of the point are specified using floating point numbers for accuracy. The isNull() function returns true if both x and y are set to 0.0. The coordinates can be set (or altered) using the setX() and setY() functions
In addition, the QPointF class provides a constructor converting a QPoint object into a QPointF object, and a corresponding toPoint() function which returns a QPoint copy of this point.
↳ QPointF
+ new QPointF(nativeOrXOrQPoint?: NativeElement | number | QPoint, y: number): QPointF
Overrides Component.constructor
Parameters:
| Name | Type | Default |
|---|---|---|
nativeOrXOrQPoint? | NativeElement | number | QPoint | - |
y | number | 0 |
Returns: QPointF
• native: NativeElement | null
Inherited from Component.native
▸ isNull(): boolean
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns false.
Returns: boolean
▸ manhattanLength(): number
Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" of the vector from the origin to the point.
Returns: number
▸ setX(value: number): void
Sets the x coordinate of this point to the given x coordinate.
Parameters:
| Name | Type |
|---|---|
value | number |
Returns: void
▸ setY(value: number): void
Sets the y coordinate of this point to the given y coordinate.
Parameters:
| Name | Type |
|---|---|
value | number |
Returns: void
▸ toPoint(): QPoint
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates.
Returns: QPoint
▸ transposed(): QPointF
Returns a point with x and y coordinates exchanged
Returns: QPointF
▸ x(): number
Returns the x coordinate of this point
Returns: number
▸ y(): number
Returns the y coordinate of this point
Returns: number
Static dotProduct▸ dotProduct(p1: QPointF, p2: QPointF): number
Returns the dot product of p1 and p2
Parameters:
| Name | Type |
|---|---|
p1 | QPointF |
p2 | QPointF |
Returns: number