diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-07-20 10:56:54 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-25 19:32:41 +0200 |
commit | 79b742b7e01ba5fa46b45578660d0e1f9ce0dae6 (patch) | |
tree | c17e06e84aed38d294e9d02ecca36bf51b4fc2a8 /src/network/socket/qabstractsocket.h | |
parent | 7d110111da72f9af5c94b66d402c18355bc16fda (diff) | |
download | qtbase-79b742b7e01ba5fa46b45578660d0e1f9ce0dae6.tar.gz |
QtNetwork: use nullary version of qRegisterMetaType<T>("T")
Using the nullary version has the advantage that multiple calls
during a program run are much more efficient, since an inlined
atomic is used to store the result. It also ensures that
Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>("T")
will happily register anything. So I've added the macro where it
was missing, or moved it to a central place when it existed
hidden.
In tst_qnetworkreply, this became a bit tricky, because a private
header is conditionally included, so moved the Q_DECLARE_METATYPE()
into a conditional section, too.
Change-Id: I71484523e4277f4697b7d4b2ddc3505375162727
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/network/socket/qabstractsocket.h')
-rw-r--r-- | src/network/socket/qabstractsocket.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h index dedde9649a..c384336b11 100644 --- a/src/network/socket/qabstractsocket.h +++ b/src/network/socket/qabstractsocket.h @@ -238,6 +238,9 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug, QAbstractSocket::SocketState); QT_END_NAMESPACE +Q_DECLARE_METATYPE(QAbstractSocket::SocketState) +Q_DECLARE_METATYPE(QAbstractSocket::SocketError) + QT_END_HEADER #endif // QABSTRACTSOCKET_H |