Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QPointF Class Reference

List of all members.

Detailed Description

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:

doc/src/snippets/code/src.corelib.tools.qpoint.cpp 9

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, QPolygonF

Definition at line 191 of file qpoint.h.

Public Member Functions

bool isNull () const
QPointFoperator*= (qreal c)
QPointFoperator+= (const QPointF &p)
QPointFoperator-= (const QPointF &p)
QPointFoperator/= (qreal c)
 QPointF (qreal xpos, qreal ypos)
 QPointF (const QPoint &p)
 QPointF ()
qreal & rx ()
qreal & ry ()
void setX (qreal x)
void setY (qreal y)
QPoint toPoint () const
qreal x () const
qreal y () const

Private Attributes

qreal xp
qreal yp


bool operator!= (const QPointF &, const QPointF &)
const QPointF operator* (const QPointF &, qreal)
const QPointF operator* (qreal, const QPointF &)
const QPointF operator+ (const QPointF &, const QPointF &)
const QPointF operator- (const QPointF &)
const QPointF operator- (const QPointF &, const QPointF &)
const QPointF operator/ (const QPointF &, qreal)
bool operator== (const QPointF &, const QPointF &)
class QMatrix
class QTransform

Related Functions

(Note that these are not member functions.)

QDataStreamoperator<< (QDataStream &stream, const QPointF &point)
QDataStreamoperator>> (QDataStream &stream, QPointF &point)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index