From 7c8d2592313acd023270b273754692677d1749c3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 5 Apr 2012 16:42:41 +0200 Subject: Q_DECLARE_SHARED: mark the type movable All implicitly shared classes are by definition movable, so this patch adds Q_DECLARE_TYPEINFO(Type, Q_MOVABLE_TYPE) to Q_DECLARE_SHARED. Change-Id: Idf8989ae1a7ed6d1ac13fccb7eaef7395a875350 Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart --- src/corelib/global/qtypeinfo.h | 1 + src/corelib/io/qfileinfo.h | 2 +- src/corelib/io/qurl.h | 1 - src/corelib/io/qurlquery.h | 1 - src/corelib/kernel/qvariant.h | 1 - src/corelib/tools/qbitarray.h | 1 - src/corelib/tools/qbytearray.h | 1 - src/corelib/tools/qstring.h | 1 - src/gui/image/qicon.h | 1 - src/gui/image/qimage.h | 1 - src/gui/kernel/qkeysequence.h | 2 +- src/gui/painting/qbrush.h | 1 - src/gui/painting/qpen.h | 2 +- 13 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index de484006c5..4255548b0d 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -181,6 +181,7 @@ namespace std { \ QT_BEGIN_NAMESPACE #define Q_DECLARE_SHARED(TYPE) \ +Q_DECLARE_TYPEINFO(TYPE, Q_MOVABLE_TYPE); \ template <> inline void qSwap(TYPE &value1, TYPE &value2) \ { value1.swap(value2); } \ Q_DECLARE_SHARED_STL(TYPE) diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h index 41db9d711d..6b1f79ab3c 100644 --- a/src/corelib/io/qfileinfo.h +++ b/src/corelib/io/qfileinfo.h @@ -150,7 +150,7 @@ private: } }; -Q_DECLARE_TYPEINFO(QFileInfo, Q_MOVABLE_TYPE); +Q_DECLARE_SHARED(QFileInfo) typedef QList QFileInfoList; diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 90b29ed958..5096d9c1d9 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -329,7 +329,6 @@ public: inline DataPtr &data_ptr() { return d; } }; -Q_DECLARE_TYPEINFO(QUrl, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QUrl) Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::ComponentFormattingOptions) //Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::FormattingOptions) diff --git a/src/corelib/io/qurlquery.h b/src/corelib/io/qurlquery.h index 5939fd938a..5eac44f327 100644 --- a/src/corelib/io/qurlquery.h +++ b/src/corelib/io/qurlquery.h @@ -111,7 +111,6 @@ public: inline DataPtr &data_ptr() { return d; } }; -Q_DECLARE_TYPEINFO(QUrlQuery, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QUrlQuery) #if QT_DEPRECATED_SINCE(5,0) diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index a415b0e3a7..c06a441468 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -576,7 +576,6 @@ inline QT_DEPRECATED bool qVariantCanConvert(const QVariant &variant) #endif Q_DECLARE_SHARED(QVariant) -Q_DECLARE_TYPEINFO(QVariant, Q_MOVABLE_TYPE); #ifndef QT_NO_DEBUG_STREAM Q_CORE_EXPORT QDebug operator<<(QDebug, const QVariant &); diff --git a/src/corelib/tools/qbitarray.h b/src/corelib/tools/qbitarray.h index 5ccb5c0fd7..403c266941 100644 --- a/src/corelib/tools/qbitarray.h +++ b/src/corelib/tools/qbitarray.h @@ -172,7 +172,6 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QBitArray &); Q_CORE_EXPORT QDebug operator<<(QDebug, const QBitArray &); #endif -Q_DECLARE_TYPEINFO(QBitArray, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QBitArray) QT_END_NAMESPACE diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 82675e00e3..1682db0802 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -606,7 +606,6 @@ inline QByteArray qUncompress(const QByteArray& data) { return qUncompress(reinterpret_cast(data.constData()), data.size()); } #endif -Q_DECLARE_TYPEINFO(QByteArray, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QByteArray) QT_END_NAMESPACE diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index f136d74dc9..2edfc04502 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -1161,7 +1161,6 @@ Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QString &); Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QString &); #endif -Q_DECLARE_TYPEINFO(QString, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QString) Q_DECLARE_OPERATORS_FOR_FLAGS(QString::SectionFlags) diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h index 264b672c8c..ca1a1af961 100644 --- a/src/gui/image/qicon.h +++ b/src/gui/image/qicon.h @@ -128,7 +128,6 @@ public: }; Q_DECLARE_SHARED(QIcon) -Q_DECLARE_TYPEINFO(QIcon, Q_MOVABLE_TYPE); #if !defined(QT_NO_DATASTREAM) Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QIcon &); diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index aa81061c24..eafd7eb598 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -304,7 +304,6 @@ public: }; Q_DECLARE_SHARED(QImage) -Q_DECLARE_TYPEINFO(QImage, Q_MOVABLE_TYPE); // Inline functions... diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h index 4cae253b50..4e0f1dfbff 100644 --- a/src/gui/kernel/qkeysequence.h +++ b/src/gui/kernel/qkeysequence.h @@ -211,7 +211,7 @@ public: typedef QKeySequencePrivate * DataPtr; inline DataPtr &data_ptr() { return d; } }; -Q_DECLARE_TYPEINFO(QKeySequence, Q_MOVABLE_TYPE); + Q_DECLARE_SHARED(QKeySequence) #ifndef QT_NO_DEBUG_STREAM diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h index b4cffc45db..df41f2ad89 100644 --- a/src/gui/painting/qbrush.h +++ b/src/gui/painting/qbrush.h @@ -145,7 +145,6 @@ public: inline void QBrush::setColor(Qt::GlobalColor acolor) { setColor(QColor(acolor)); } -Q_DECLARE_TYPEINFO(QBrush, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QBrush) /***************************************************************************** diff --git a/src/gui/painting/qpen.h b/src/gui/painting/qpen.h index 35b3f5eec6..f461f1b59e 100644 --- a/src/gui/painting/qpen.h +++ b/src/gui/painting/qpen.h @@ -130,7 +130,7 @@ public: typedef QPenPrivate * DataPtr; inline DataPtr &data_ptr() { return d; } }; -Q_DECLARE_TYPEINFO(QPen, Q_MOVABLE_TYPE); + Q_DECLARE_SHARED(QPen) #ifndef QT_NO_DEBUG_STREAM -- cgit v1.2.3