QT——QPoint类详解

QPoint类的主要功能是定义了平面上的一个点的坐标,数据类型为int类型,如果想要float类型就需要QPointF。

公共函数

QPoint ()
QPoint ( int x, int y )
bool isNull () const——Returns true if both the x and y coordinates are set to 0, otherwise returns false.
int manhattanLength () const——返回x()和y()的绝对值得和,就是传统上的从原点开始的矢量的“曼哈顿长度”
int & rx ()——得到横坐标的引用
int & ry ()——得到纵坐标的引用
void setX ( int x )——设置横坐标
void setY ( int y )——设置纵坐标
int x () const——获得横坐标
int y () const——获得纵坐标
QPoint & operator*= ( float factor )
QPoint & operator*= ( double factor )
QPoint & operator*= ( int factor )
QPoint & operator+= ( const QPoint & point )
QPoint & operator-= ( const QPoint & point )
QPoint & operator/= ( qreal divisor )
原文地址:https://www.cnblogs.com/baiweituyou/p/14427267.html