*/
/*!
+ \fn const QPoint operator+(const QPoint &point)
+ \relates QPoint
+ \since 5.0
+
+ Returns \a point unmodified.
+*/
+
+/*!
\fn const QPoint operator-(const QPoint &point)
\overload
\relates QPoint
*/
/*!
+ \fn const QPointF operator+(const QPointF &point)
+ \relates QPointF
+ \since 5.0
+
+ Returns \a point unmodified.
+*/
+
+/*!
\fn const QPointF operator-(const QPointF &point)
\relates QPointF
\overload
friend Q_DECL_CONSTEXPR inline const QPoint operator*(double, const QPoint &);
friend Q_DECL_CONSTEXPR inline const QPoint operator*(const QPoint &, int);
friend Q_DECL_CONSTEXPR inline const QPoint operator*(int, const QPoint &);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator+(const QPoint &);
friend Q_DECL_CONSTEXPR inline const QPoint operator-(const QPoint &);
friend Q_DECL_CONSTEXPR inline const QPoint operator/(const QPoint &, qreal);
Q_DECL_CONSTEXPR inline const QPoint operator*(int factor, const QPoint &p)
{ return QPoint(p.xp*factor, p.yp*factor); }
+Q_DECL_CONSTEXPR inline const QPoint operator+(const QPoint &p)
+{ return p; }
+
Q_DECL_CONSTEXPR inline const QPoint operator-(const QPoint &p)
{ return QPoint(-p.xp, -p.yp); }
friend Q_DECL_CONSTEXPR inline const QPointF operator-(const QPointF &, const QPointF &);
friend Q_DECL_CONSTEXPR inline const QPointF operator*(qreal, const QPointF &);
friend Q_DECL_CONSTEXPR inline const QPointF operator*(const QPointF &, qreal);
+ friend Q_DECL_CONSTEXPR inline const QPointF operator+(const QPointF &);
friend Q_DECL_CONSTEXPR inline const QPointF operator-(const QPointF &);
friend Q_DECL_CONSTEXPR inline const QPointF operator/(const QPointF &, qreal);
return QPointF(p.xp*c, p.yp*c);
}
+Q_DECL_CONSTEXPR inline const QPointF operator+(const QPointF &p)
+{
+ return p;
+}
+
Q_DECL_CONSTEXPR inline const QPointF operator-(const QPointF &p)
{
return QPointF(-p.xp, -p.yp);
void operator_divide_data();
void operator_divide();
+ void operator_unary_plus_data();
+ void operator_unary_plus();
+
void operator_unary_minus_data();
void operator_unary_minus();
QCOMPARE(point, expected);
}
+void tst_QPoint::operator_unary_plus_data()
+{
+ operator_unary_minus_data();
+}
+
+void tst_QPoint::operator_unary_plus()
+{
+ QFETCH(QPoint, point);
+ // Should be a NOOP.
+ QCOMPARE(+point, point);
+}
+
void tst_QPoint::operator_unary_minus_data()
{
QTest::addColumn<QPoint>("point");
void operator_divide();
void division();
+ void operator_unary_plus_data();
+ void operator_unary_plus();
+
void operator_unary_minus_data();
void operator_unary_minus();
}
}
+void tst_QPointF::operator_unary_plus_data()
+{
+ operator_unary_minus_data();
+}
+
+void tst_QPointF::operator_unary_plus()
+{
+ QFETCH(QPointF, point);
+ // Should be a NOOP.
+ QCOMPARE(+point, point);
+}
+
void tst_QPointF::operator_unary_minus_data()
{
QTest::addColumn<QPointF>("point");