QPointF

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.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

+ new QPointF(): QPointF

Overrides Component.constructor

Returns: QPointF

+ new QPointF(nativeElement: NativeElement): QPointF

Overrides Component.constructor

Parameters:

NameType
nativeElementNativeElement

Returns: QPointF

+ new QPointF(x?: undefined | number, y?: undefined | number): QPointF

Overrides Component.constructor

Parameters:

NameType
x?undefined | number
y?undefined | number

Returns: QPointF

+ new QPointF(point: QPoint): QPointF

Overrides Component.constructor

Parameters:

NameType
pointQPoint

Returns: QPointF

Properties

native

native: NativeElement

Overrides Component.native


nodeChildren

nodeChildren: Set‹Component

Inherited from Component.nodeChildren


Optional nodeParent

nodeParent? : Component

Inherited from Component.nodeParent

Methods

isNull

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

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


setNodeParent

setNodeParent(parent?: Component): void

Inherited from Component.setNodeParent

Parameters:

NameType
parent?Component

Returns: void


setX

setX(value: number): void

Sets the x coordinate of this point to the given x coordinate.

Parameters:

NameType
valuenumber

Returns: void


setY

setY(value: number): void

Sets the y coordinate of this point to the given y coordinate.

Parameters:

NameType
valuenumber

Returns: void


toPoint

toPoint(): QPoint

Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates.

Returns: QPoint


transposed

transposed(): QPointF

Returns a point with x and y coordinates exchanged

Returns: QPointF


x

x(): number

Returns the x coordinate of this point

Returns: number


y

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:

NameType
p1QPointF
p2QPointF

Returns: number