Move the QDataStream operator<< for QPair to qdatastream.h
QPair is small and is no problem to include from qdatastream.h. However, including QDataStream from qpair.h means including QIODevice and QObject too. Change-Id: I344321e9f68438008ec329a165135c3a346c6058 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>bb10
parent
7395e6abc6
commit
55150f0f0b
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include <QtCore/qscopedpointer.h>
|
||||
#include <QtCore/qiodevice.h>
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore/qpair.h>
|
||||
|
||||
#ifdef Status
|
||||
#error qdatastream.h must be included before any header file that defines Status
|
||||
|
|
@ -414,6 +414,22 @@ Q_OUTOFLINE_TEMPLATE QDataStream &operator<<(QDataStream &out, const QMap<Key, T
|
|||
return out;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DATASTREAM
|
||||
template <class T1, class T2>
|
||||
inline QDataStream& operator>>(QDataStream& s, QPair<T1, T2>& p)
|
||||
{
|
||||
s >> p.first >> p.second;
|
||||
return s;
|
||||
}
|
||||
|
||||
template <class T1, class T2>
|
||||
inline QDataStream& operator<<(QDataStream& s, const QPair<T1, T2>& p)
|
||||
{
|
||||
s << p.first << p.second;
|
||||
return s;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // QT_NO_DATASTREAM
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
#ifndef QPAIR_H
|
||||
#define QPAIR_H
|
||||
|
||||
#include <QtCore/qdatastream.h>
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
|
|
@ -117,22 +117,6 @@ Q_OUTOFLINE_TEMPLATE QPair<T1, T2> qMakePair(const T1 &x, const T2 &y)
|
|||
return QPair<T1, T2>(x, y);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DATASTREAM
|
||||
template <class T1, class T2>
|
||||
inline QDataStream& operator>>(QDataStream& s, QPair<T1, T2>& p)
|
||||
{
|
||||
s >> p.first >> p.second;
|
||||
return s;
|
||||
}
|
||||
|
||||
template <class T1, class T2>
|
||||
inline QDataStream& operator<<(QDataStream& s, const QPair<T1, T2>& p)
|
||||
{
|
||||
s << p.first << p.second;
|
||||
return s;
|
||||
}
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include "qquaternion.h"
|
||||
#include <QtCore/qdatastream.h>
|
||||
#include <QtCore/qmath.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "qvector2d.h"
|
||||
#include "qvector3d.h"
|
||||
#include "qvector4d.h"
|
||||
#include <QtCore/qdatastream.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qmath.h>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "qvector3d.h"
|
||||
#include "qvector2d.h"
|
||||
#include "qvector4d.h"
|
||||
#include <QtCore/qdatastream.h>
|
||||
#include <QtCore/qmath.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "qvector4d.h"
|
||||
#include "qvector3d.h"
|
||||
#include "qvector2d.h"
|
||||
#include <QtCore/qdatastream.h>
|
||||
#include <QtCore/qdebug.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtCore/qmath.h>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "qabstractnetworkcache.h"
|
||||
#include "qabstractnetworkcache_p.h"
|
||||
|
||||
#include <qdatastream.h>
|
||||
#include <qdatetime.h>
|
||||
#include <qurl.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
#include <QtCore/QSharedDataPointer>
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QIODevice>
|
||||
#include <QtNetwork/QNetworkRequest>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
|
||||
#include <QtCore/qhash.h>
|
||||
#include <QtCore/qpair.h>
|
||||
#include <QtCore/qstring.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@
|
|||
#ifndef QWIDGETITEMDATA_P_H
|
||||
#define QWIDGETITEMDATA_P_H
|
||||
|
||||
#include <QtCore/qdatastream.h>
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
|
|
|
|||
Loading…
Reference in New Issue