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 <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2012-04-05 16:42:41 +02:00 committed by Qt by Nokia
parent 9fb539085e
commit 7c8d259231
13 changed files with 4 additions and 12 deletions

View File

@ -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>(TYPE &value1, TYPE &value2) \
{ value1.swap(value2); } \
Q_DECLARE_SHARED_STL(TYPE)

View File

@ -150,7 +150,7 @@ private:
}
};
Q_DECLARE_TYPEINFO(QFileInfo, Q_MOVABLE_TYPE);
Q_DECLARE_SHARED(QFileInfo)
typedef QList<QFileInfo> QFileInfoList;

View File

@ -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)

View File

@ -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)

View File

@ -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 &);

View File

@ -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

View File

@ -606,7 +606,6 @@ inline QByteArray qUncompress(const QByteArray& data)
{ return qUncompress(reinterpret_cast<const uchar*>(data.constData()), data.size()); }
#endif
Q_DECLARE_TYPEINFO(QByteArray, Q_MOVABLE_TYPE);
Q_DECLARE_SHARED(QByteArray)
QT_END_NAMESPACE

View File

@ -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)

View File

@ -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 &);

View File

@ -304,7 +304,6 @@ public:
};
Q_DECLARE_SHARED(QImage)
Q_DECLARE_TYPEINFO(QImage, Q_MOVABLE_TYPE);
// Inline functions...

View File

@ -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

View File

@ -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)
/*****************************************************************************

View File

@ -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