From 1bd24e5b0c7c329e8e6b00e85d2d360abf5630c6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 24 Jun 2015 09:48:50 +0200 Subject: QtGui: Mark some more types as shared for Qt 6. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Marking them shared (which implies movable) now would make QLists of these BiC. Change-Id: If5638e8d9f43e0ad549aedf08934de31e1e189f1 Reviewed-by: Lars Knoll Reviewed-by: Jędrzej Nowacki --- src/gui/kernel/qcursor.h | 8 ++++++-- src/gui/painting/qpainterpath.h | 1 + src/gui/painting/qpolygon.h | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h index 1b11bad69f..814e8ab7bd 100644 --- a/src/gui/kernel/qcursor.h +++ b/src/gui/kernel/qcursor.h @@ -87,9 +87,12 @@ public: QCursor &operator=(const QCursor &cursor); #ifdef Q_COMPILER_RVALUE_REFS QCursor(QCursor &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; } - inline QCursor &operator=(QCursor &&other) - { qSwap(d, other.d); return *this; } + inline QCursor &operator=(QCursor &&other) Q_DECL_NOTHROW + { swap(other); return *this; } #endif + + void swap(QCursor &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + operator QVariant() const; Qt::CursorShape shape() const; @@ -110,6 +113,7 @@ public: private: QCursorData *d; }; +Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QCursor) /***************************************************************************** QCursor stream functions diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 8513e6d407..882918fc87 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -230,6 +230,7 @@ private: #endif }; +Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPainterPath) Q_DECLARE_TYPEINFO(QPainterPath::Element, Q_PRIMITIVE_TYPE); #ifndef QT_NO_DATASTREAM diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h index 7b77ee5014..23bdd1933f 100644 --- a/src/gui/painting/qpolygon.h +++ b/src/gui/painting/qpolygon.h @@ -98,6 +98,7 @@ public: QPolygon intersected(const QPolygon &r) const Q_REQUIRED_RESULT; QPolygon subtracted(const QPolygon &r) const Q_REQUIRED_RESULT; }; +Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygon) inline QPolygon::QPolygon(int asize) : QVector(asize) {} @@ -174,6 +175,7 @@ public: QPolygonF intersected(const QPolygonF &r) const Q_REQUIRED_RESULT; QPolygonF subtracted(const QPolygonF &r) const Q_REQUIRED_RESULT; }; +Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygonF) inline QPolygonF::QPolygonF(int asize) : QVector(asize) {} -- cgit v1.2.3