QPointF Class Reference

QPointF Class Reference

#include <qpoint.h>

Class Description

Definition at line 214 of file qpoint.h.

Public Member Functions

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

Friends

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

Constructor & Destructor Documentation

QPointF ( )
inline

Definition at line 271 of file qpoint.h.

271 : xp(0), yp(0) { }
QPointF ( const QPoint p)
inline

Definition at line 275 of file qpoint.h.

275 : xp(p.x()), yp(p.y()) { }
int y() const
Definition: qpoint.h:131
int x() const
Definition: qpoint.h:128
QPointF ( qreal  xpos,
qreal  ypos 
)
inline

Definition at line 273 of file qpoint.h.

273 : xp(xpos), yp(ypos) { }

Member Function Documentation

qreal manhattanLength ( ) const
bool isNull ( ) const
inline

Definition at line 277 of file qpoint.h.

278 {
279  return qIsNull(xp) && qIsNull(yp);
280 }
qreal x ( ) const
inline

Definition at line 282 of file qpoint.h.

283 {
284  return xp;
285 }
qreal y ( ) const
inline

Definition at line 287 of file qpoint.h.

288 {
289  return yp;
290 }
void setX ( qreal  x)
inline

Definition at line 292 of file qpoint.h.

293 {
294  xp = xpos;
295 }
void setY ( qreal  y)
inline

Definition at line 297 of file qpoint.h.

298 {
299  yp = ypos;
300 }
qreal & rx ( )
inline

Definition at line 302 of file qpoint.h.

303 {
304  return xp;
305 }
qreal & ry ( )
inline

Definition at line 307 of file qpoint.h.

308 {
309  return yp;
310 }
QPointF & operator+= ( const QPointF p)
inline

Definition at line 312 of file qpoint.h.

313 {
314  xp+=p.xp;
315  yp+=p.yp;
316  return *this;
317 }
QPointF & operator-= ( const QPointF p)
inline

Definition at line 319 of file qpoint.h.

320 {
321  xp-=p.xp; yp-=p.yp; return *this;
322 }
QPointF & operator*= ( qreal  c)
inline

Definition at line 324 of file qpoint.h.

325 {
326  xp*=c; yp*=c; return *this;
327 }
const GLubyte * c
Definition: GLee.h:5419
QPointF & operator/= ( qreal  c)
inline

Definition at line 364 of file qpoint.h.

365 {
366  xp/=c;
367  yp/=c;
368  return *this;
369 }
const GLubyte * c
Definition: GLee.h:5419
QPoint toPoint ( ) const
inline

Definition at line 376 of file qpoint.h.

377 {
378  return QPoint(qRound(xp), qRound(yp));
379 }
Definition: qpoint.h:53

Friends And Related Function Documentation

friend class QMatrix
friend

Definition at line 250 of file qpoint.h.

friend class QTransform
friend

Definition at line 251 of file qpoint.h.

bool operator== ( const QPointF p1,
const QPointF p2 
)
friend

Definition at line 329 of file qpoint.h.

330 {
331  return qFuzzyIsNull(p1.xp - p2.xp) && qFuzzyIsNull(p1.yp - p2.yp);
332 }
bool operator!= ( const QPointF p1,
const QPointF p2 
)
friend

Definition at line 334 of file qpoint.h.

335 {
336  return !qFuzzyIsNull(p1.xp - p2.xp) || !qFuzzyIsNull(p1.yp - p2.yp);
337 }
const QPointF operator+ ( const QPointF p1,
const QPointF p2 
)
friend

Definition at line 339 of file qpoint.h.

340 {
341  return QPointF(p1.xp+p2.xp, p1.yp+p2.yp);
342 }
QPointF()
Definition: qpoint.h:271
const QPointF operator- ( const QPointF p1,
const QPointF p2 
)
friend

Definition at line 344 of file qpoint.h.

345 {
346  return QPointF(p1.xp-p2.xp, p1.yp-p2.yp);
347 }
QPointF()
Definition: qpoint.h:271
const QPointF operator* ( qreal  c,
const QPointF p 
)
friend

Definition at line 354 of file qpoint.h.

355 {
356  return QPointF(p.xp*c, p.yp*c);
357 }
QPointF()
Definition: qpoint.h:271
const GLubyte * c
Definition: GLee.h:5419
const QPointF operator* ( const QPointF p,
qreal  c 
)
friend

Definition at line 349 of file qpoint.h.

350 {
351  return QPointF(p.xp*c, p.yp*c);
352 }
QPointF()
Definition: qpoint.h:271
const GLubyte * c
Definition: GLee.h:5419
const QPointF operator- ( const QPointF p)
friend

Definition at line 359 of file qpoint.h.

360 {
361  return QPointF(-p.xp, -p.yp);
362 }
QPointF()
Definition: qpoint.h:271
const QPointF operator/ ( const QPointF p,
qreal  c 
)
friend

Definition at line 371 of file qpoint.h.

372 {
373  return QPointF(p.xp/c, p.yp/c);
374 }
QPointF()
Definition: qpoint.h:271
const GLubyte * c
Definition: GLee.h:5419

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