diff options
Diffstat (limited to 'src/corelib/tools/qpoint.cpp')
-rw-r--r-- | src/corelib/tools/qpoint.cpp | 65 |
1 files changed, 61 insertions, 4 deletions
diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp index c297709..2a13fc4 100644 --- a/src/corelib/tools/qpoint.cpp +++ b/src/corelib/tools/qpoint.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -187,7 +187,19 @@ QT_BEGIN_NAMESPACE */ /*! - \fn QPoint &QPoint::operator*=(qreal factor) + \fn QPoint &QPoint::operator*=(float factor) + + Multiplies this point's coordinates by the given \a factor, and + returns a reference to this point. + + Note that the result is rounded to the nearest integer as points are held as + integers. Use QPointF for floating point accuracy. + + \sa operator/=() +*/ + +/*! + \fn QPoint &QPoint::operator*=(double factor) Multiplies this point's coordinates by the given \a factor, and returns a reference to this point. For example: @@ -200,6 +212,14 @@ QT_BEGIN_NAMESPACE \sa operator/=() */ +/*! + \fn QPoint &QPoint::operator*=(int factor) + + Multiplies this point's coordinates by the given \a factor, and + returns a reference to this point. + + \sa operator/=() +*/ /*! \fn bool operator==(const QPoint &p1, const QPoint &p2) @@ -237,7 +257,7 @@ QT_BEGIN_NAMESPACE */ /*! - \fn const QPoint operator*(const QPoint &point, qreal factor) + \fn const QPoint operator*(const QPoint &point, float factor) \relates QPoint Returns a copy of the given \a point multiplied by the given \a factor. @@ -249,7 +269,44 @@ QT_BEGIN_NAMESPACE */ /*! - \fn const QPoint operator*(qreal factor, const QPoint &point) + \fn const QPoint operator*(const QPoint &point, double factor) + \relates QPoint + + Returns a copy of the given \a point multiplied by the given \a factor. + + Note that the result is rounded to the nearest integer as points + are held as integers. Use QPointF for floating point accuracy. + + \sa QPoint::operator*=() +*/ + +/*! + \fn const QPoint operator*(const QPoint &point, int factor) + \relates QPoint + + Returns a copy of the given \a point multiplied by the given \a factor. + + \sa QPoint::operator*=() +*/ + +/*! + \fn const QPoint operator*(float factor, const QPoint &point) + \overload + \relates QPoint + + Returns a copy of the given \a point multiplied by the given \a factor. +*/ + +/*! + \fn const QPoint operator*(double factor, const QPoint &point) + \overload + \relates QPoint + + Returns a copy of the given \a point multiplied by the given \a factor. +*/ + +/*! + \fn const QPoint operator*(int factor, const QPoint &point) \overload \relates QPoint |