QPointF

Inheritance diagram of PySide2.QtCore.QPointF

Synopsis

Functions

Static functions

Detailed Description

The PySide2.QtCore.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 PySide2.QtCore.QPointF.x() and PySide2.QtCore.QPointF.y() functions. The coordinates of the point are specified using floating point numbers for accuracy. The PySide2.QtCore.QPointF.isNull() function returns true if both x and y are set to 0.0. The coordinates can be set (or altered) using the PySide2.QtCore.QPointF.setX() and PySide2.QtCore.QPointF.setY() functions, or alternatively the PySide2.QtCore.QPointF.rx() and PySide2.QtCore.QPointF.ry() functions which return references to the coordinates (allowing direct manipulation).

Given a point p , the following statements are all equivalent:

p = QPointF()

p.setX(p.x() + 1.0)
p += QPointF(1.0, 0.0)
#p.rx()++;

A PySide2.QtCore.QPointF object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). A PySide2.QtCore.QPointF object can also be divided or multiplied by an int or a qreal .

In addition, the PySide2.QtCore.QPointF class provides a constructor converting a PySide2.QtCore.QPoint object into a PySide2.QtCore.QPointF object, and a corresponding PySide2.QtCore.QPointF.toPoint() function which returns a PySide2.QtCore.QPoint copy of this point. Finally, PySide2.QtCore.QPointF objects can be streamed as well as compared.

class PySide2.QtCore.QPointF
class PySide2.QtCore.QPointF(p)
class PySide2.QtCore.QPointF(QPointF)
class PySide2.QtCore.QPointF(xpos, ypos)
Parameters:

Constructs a null point, i.e. with coordinates (0.0, 0.0)

Constructs a copy of the given point .

Constructs a point with the given coordinates (xpos , ypos ).

PySide2.QtCore.QPointF.__reduce__()
Return type:PyObject
PySide2.QtCore.QPointF.__repr__()
Return type:PyObject
static PySide2.QtCore.QPointF.dotProduct(p1, p2)
Parameters:
Return type:

PySide2.QtCore.qreal

QPointF p( 3.1, 7.1);
QPointF q(-1.0, 4.1);
int lengthSquared = QPointF::dotProduct(p, q);   // lengthSquared becomes 26.01

Returns the dot product of p1 and p2 .

PySide2.QtCore.QPointF.isNull()
Return type:PySide2.QtCore.bool

Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns false .

PySide2.QtCore.QPointF.manhattanLength()
Return type:PySide2.QtCore.qreal

Returns the sum of the absolute values of PySide2.QtCore.QPointF.x() and PySide2.QtCore.QPointF.y() , traditionally known as the “Manhattan length” of the vector from the origin to the point.

PySide2.QtCore.QPointF.__ne__(p2)
Parameters:p2PySide2.QtCore.QPointF
Return type:PySide2.QtCore.bool
PySide2.QtCore.QPointF.__mul__(c)
Parameters:cPySide2.QtCore.qreal
Return type:PySide2.QtCore.QPointF
PySide2.QtCore.QPointF.__mul__(m)
Parameters:mPySide2.QtGui.QTransform
Return type:PySide2.QtCore.QPointF
PySide2.QtCore.QPointF.__mul__(c)
Parameters:cPySide2.QtCore.qreal
Return type:PySide2.QtCore.QPointF
PySide2.QtCore.QPointF.__mul__(matrix)
Parameters:matrixPySide2.QtGui.QMatrix4x4
Return type:PySide2.QtCore.QPointF
PySide2.QtCore.QPointF.__mul__(m)
Parameters:mPySide2.QtGui.QMatrix
Return type:PySide2.QtCore.QPointF
PySide2.QtCore.QPointF.__mul__(matrix)
Parameters:matrixPySide2.QtGui.QMatrix4x4
Return type:PySide2.QtCore.QPointF
PySide2.QtCore.QPointF.__imul__(c)
Parameters:cPySide2.QtCore.qreal
Return type:PySide2.QtCore.QPointF

Multiplies this point’s coordinates by the given factor , and returns a reference to this point. For example:

p = QPointF(-1.1, 4.1)
p *= 2.5  # p becomes (-2.75, 10.25)

See also

PySide2.QtCore.QPointF.operator/=()

PySide2.QtCore.QPointF.__add__(p2)
Parameters:p2PySide2.QtCore.QPointF
Return type:PySide2.QtCore.QPointF

Returns point unmodified.

PySide2.QtCore.QPointF.__add__()
Return type:PySide2.QtCore.QPointF
PySide2.QtCore.QPointF.__iadd__(p)
Parameters:pPySide2.QtCore.QPointF
Return type:PySide2.QtCore.QPointF

Adds the given point to this point and returns a reference to this point. For example:

p = QPointF( 3.1, 7.1)
q = QPointF(-1.0, 4.1)
p += q    # p becomes (2.1, 11.2)

See also

PySide2.QtCore.QPointF.operator-=()

PySide2.QtCore.QPointF.__sub__()
Return type:PySide2.QtCore.QPointF
PySide2.QtCore.QPointF.__sub__(p2)
Parameters:p2PySide2.QtCore.QPointF
Return type:PySide2.QtCore.QPointF

This is an overloaded function.

Returns a PySide2.QtCore.QPointF object that is formed by changing the sign of both components of the given point .

Equivalent to QPointF(0,0) - point .

PySide2.QtCore.QPointF.__isub__(p)
Parameters:pPySide2.QtCore.QPointF
Return type:PySide2.QtCore.QPointF

Subtracts the given point from this point and returns a reference to this point. For example:

p = QPointF( 3.1, 7.1)
q = QPointF(-1.0, 4.1)
p -= q    # p becomes (4.1, 3.0)

See also

PySide2.QtCore.QPointF.operator+=()

PySide2.QtCore.QPointF.__div__(divisor)
Parameters:divisorPySide2.QtCore.qreal
Return type:PySide2.QtCore.QPointF
PySide2.QtCore.QPointF.__idiv__(c)
Parameters:cPySide2.QtCore.qreal
Return type:PySide2.QtCore.QPointF

Divides both x and y by the given divisor , and returns a reference to this point. For example:

p = QPointF(-2.75, 10.25)
p /= 2.5  # p becomes (-1.1, 4.1)

See also

PySide2.QtCore.QPointF.operator*=()

PySide2.QtCore.QPointF.__eq__(p2)
Parameters:p2PySide2.QtCore.QPointF
Return type:PySide2.QtCore.bool
PySide2.QtCore.QPointF.setX(x)
Parameters:xPySide2.QtCore.qreal

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

PySide2.QtCore.QPointF.setY(y)
Parameters:yPySide2.QtCore.qreal

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

PySide2.QtCore.QPointF.toPoint()
Return type:PySide2.QtCore.QPoint

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

See also

PySide2.QtCore.QPointF.QPointF()

PySide2.QtCore.QPointF.toTuple()
Return type:PyObject
PySide2.QtCore.QPointF.x()
Return type:PySide2.QtCore.qreal

Returns the x coordinate of this point.

See also

PySide2.QtCore.QPointF.setX() PySide2.QtCore.QPointF.rx()

PySide2.QtCore.QPointF.y()
Return type:PySide2.QtCore.qreal

Returns the y coordinate of this point.

See also

PySide2.QtCore.QPointF.setY() PySide2.QtCore.QPointF.ry()