![]() | Home · All Classes · Modules |
The QPointF class defines a point in the plane using floating point precision. More...
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, or alternatively the rx() and ry() functions which return references to the coordinates (allowing direct manipulation).
Given a point p, the following statements are all equivalent:
QPointF p; p.setX(p.x() + 1.0); p += QPoint(1.0, 0.0); p.rx()++;
A QPointF object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). A QPointF object can also be divided or multiplied by an int or a qreal.
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. Finally, QPointF objects can be streamed as well as compared.
See also QPoint and QPolygonF.
Constructs a null point, i.e. with coordinates (0.0, 0.0)
See also isNull().
This method is only available if the QtGui module is imported.
Constructs a null point, i.e. with coordinates (0.0, 0.0)
See also isNull().
Constructs a copy of the given point.
See also toPoint().
Constructs a point with the given coordinates (x, y).
Returns true if both the x and y coordinates are set to 0.0, otherwise returns false.
Sets the x coordinate of this point to the given x coordinate.
Sets the y coordinate of this point to the given y coordinate.
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates.
See also QPointF().
Returns the x-coordinate of this point.
Returns the y-coordinate of this point.
This method is only available if the QtGui module is imported.
This method is only available if the QtGui module is imported.
PyQt 4.3.1 for X11 | Copyright © Riverbank Computing Ltd and Trolltech AS 2007 | Qt 4.3.0 |