From 6aaac9a3b19115272faeff2a7a2275c2538fc197 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 25 Jun 2015 18:41:14 +0200 Subject: QtGui: make all Q_DECLARE_SHARED types nothrow move-assignable Excepting QBitmap and the QTextFormat heirarchy, which don't have 100% value semantics (still pondering them). In QPolygon(F), adding the move assignment operator disables the implicitly-defined copy assignment operator, which therefore have to be made user-defined. That doesn't change the ABI of the class, since the base class QVector already had a user-defined copy assignment operator. Change-Id: I0b111c1d21cf47f559ada6357c982e3dc26aca68 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/painting/qpolygon.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gui/painting/qpolygon.h') diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h index 1549ebe2b5..3890715f32 100644 --- a/src/gui/painting/qpolygon.h +++ b/src/gui/painting/qpolygon.h @@ -56,7 +56,11 @@ public: inline /*implicit*/ QPolygon(const QVector &v) : QVector(v) {} QPolygon(const QRect &r, bool closed=false); QPolygon(int nPoints, const int *points); - inline void swap(QPolygon &other) { QVector::swap(other); } // prevent QVector<->QPolygon swaps +#ifdef Q_COMPILER_RVALUE_REFS + QPolygon &operator=(QPolygon &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif + QPolygon &operator=(const QPolygon &other) { QVector::operator=(other); return *this; } + void swap(QPolygon &other) Q_DECL_NOTHROW { QVector::swap(other); } // prevent QVector<->QPolygon swaps operator QVariant() const; @@ -130,6 +134,10 @@ public: inline /*implicit*/ QPolygonF(const QVector &v) : QVector(v) {} QPolygonF(const QRectF &r); /*implicit*/ QPolygonF(const QPolygon &a); +#ifdef Q_COMPILER_RVALUE_REFS + QPolygonF &operator=(QPolygonF &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif + QPolygonF &operator=(const QPolygonF &other) { QVector::operator=(other); return *this; } inline void swap(QPolygonF &other) { QVector::swap(other); } // prevent QVector<->QPolygonF swaps operator QVariant() const; -- cgit v1.2.3