diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp index d601dcdb0c..f124691f02 100644 --- a/src/gui/painting/qpolygon.cpp +++ b/src/gui/painting/qpolygon.cpp @@ -263,13 +263,16 @@ void QPolygon::point(int index, int *x, int *y) const */ /*! - \fn void QPolygon::setPoint(int index, int x, int y) - Sets the point at the given \a index to the point specified by (\a{x}, \a{y}). \sa point(), putPoints(), setPoints(), */ +void QPolygon::setPoint(int index, int x, int y) +{ + (*this)[index] = QPoint(x, y); +} + /*! Resizes the polygon to \a nPoints and populates it with the given diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h index a8997c5e3d..f7153a9f37 100644 --- a/src/gui/painting/qpolygon.h +++ b/src/gui/painting/qpolygon.h @@ -76,8 +76,8 @@ public: Q_GUI_EXPORT void point(int i, int *x, int *y) const; QPoint point(int i) const; - void setPoint(int index, int x, int y); - void setPoint(int index, const QPoint &p); + Q_GUI_EXPORT void setPoint(int index, int x, int y); + inline void setPoint(int index, const QPoint &p); Q_GUI_EXPORT void setPoints(int nPoints, const int *points); Q_GUI_EXPORT void setPoints(int nPoints, int firstx, int firsty, ...); Q_GUI_EXPORT void putPoints(int index, int nPoints, const int *points); @@ -111,10 +111,7 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QPolygon &polygon); *****************************************************************************/ inline void QPolygon::setPoint(int index, const QPoint &pt) -{ (*this)[index] = pt; } - -inline void QPolygon::setPoint(int index, int x, int y) -{ (*this)[index] = QPoint(x, y); } +{ setPoint(index, pt.x(), pt.y()); } inline QPoint QPolygon::point(int index) const { return at(index); }