3.5 KiB
| id | title | sidebar_label |
|---|---|---|
| qpoint | QPoint | QPoint |
The QPoint class defines a point in the plane using integer precision.
Hierarchy
-
↳ QPoint
Index
Constructors
Properties
Methods
- isNull
- manhattanLength
- setNodeParent
- setX
- setY
- transposed
- (qpoint.md#x)
- y
- fromQVariant
Constructors
constructor
+ new QPoint(): QPoint
Overrides Component.constructor
Returns: QPoint
+ new QPoint(nativeElement: NativeElement): QPoint
Overrides Component.constructor
Parameters:
| Name | Type |
|---|---|
nativeElement |
NativeElement |
Returns: QPoint
+ new QPoint(x?: undefined | number, y?: undefined | number): QPoint
Overrides Component.constructor
Parameters:
| Name | Type |
|---|---|
x? |
undefined | number |
y? |
undefined | number |
Returns: QPoint
Properties
native
• native: NativeElement
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:
| Name | Type |
|---|---|
parent? |
Component |
Returns: void
setX
▸ setX(value: number): void
Parameters:
| Name | Type |
|---|---|
value |
number |
Returns: void
setY
▸ setY(value: number): void
Parameters:
| Name | Type |
|---|---|
value |
number |
Returns: void
transposed
▸ transposed(): QPoint
Returns a point with x and y coordinates exchanged
Returns: QPoint
x
▸ x(): number
Returns: number
y
▸ y(): number
Returns: number
Static fromQVariant
▸ fromQVariant(variant: QVariant): QPoint
Parameters:
| Name | Type |
|---|---|
variant |
QVariant |
Returns: QPoint