mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
register socket error and state enums as metatypes
makes no sense to have to register types externally that the socket classes use (connect) internally Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e42586803b
commit
75d4dc82b5
5 changed files with 15 additions and 23 deletions
|
@ -189,10 +189,6 @@
|
|||
This signal is emitted after an error occurred. The \a socketError
|
||||
parameter describes the type of error that occurred.
|
||||
|
||||
QAbstractSocket::SocketError is not a registered metatype, so for queued
|
||||
connections, you will have to register it with Q_DECLARE_METATYPE() and
|
||||
qRegisterMetaType().
|
||||
|
||||
\sa error(), errorString(), {Creating Custom Qt Types}
|
||||
*/
|
||||
|
||||
|
@ -202,10 +198,6 @@
|
|||
This signal is emitted whenever QAbstractSocket's state changes.
|
||||
The \a socketState parameter is the new state.
|
||||
|
||||
QAbstractSocket::SocketState is not a registered metatype, so for queued
|
||||
connections, you will have to register it with Q_REGISTER_METATYPE() and
|
||||
qRegisterMetaType().
|
||||
|
||||
\sa state(), {Creating Custom Qt Types}
|
||||
*/
|
||||
|
||||
|
@ -365,6 +357,8 @@ QAbstractSocketPrivate::QAbstractSocketPrivate()
|
|||
state(QAbstractSocket::UnconnectedState),
|
||||
socketError(QAbstractSocket::UnknownSocketError)
|
||||
{
|
||||
qRegisterMetaType<QAbstractSocket::SocketState>();
|
||||
qRegisterMetaType<QAbstractSocket::SocketError>();
|
||||
}
|
||||
|
||||
/*! \internal
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
|
||||
#include <QtCore/qiodevice.h>
|
||||
#include <QtCore/qobject.h>
|
||||
#include <QtCore/qmetatype.h>
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
#include <QtCore/qdebug.h>
|
||||
#endif
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
class QHostAddress;
|
||||
class QAbstractSocketPrivate;
|
||||
|
||||
|
@ -172,5 +172,7 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug, QAbstractSocket::SocketState);
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
Q_DECLARE_METATYPE(QAbstractSocket::SocketError);
|
||||
Q_DECLARE_METATYPE(QAbstractSocket::SocketState);
|
||||
|
||||
#endif // QABSTRACTSOCKET_H
|
||||
|
|
|
@ -286,10 +286,6 @@ QT_BEGIN_NAMESPACE
|
|||
This signal is emitted after an error occurred. The \a socketError
|
||||
parameter describes the type of error that occurred.
|
||||
|
||||
QLocalSocket::LocalSocketError is not a registered metatype, so for queued
|
||||
connections, you will have to register it with Q_DECLARE_METATYPE() and
|
||||
qRegisterMetaType().
|
||||
|
||||
\sa error(), errorString(), {Creating Custom Qt Types}
|
||||
*/
|
||||
|
||||
|
@ -299,10 +295,6 @@ QT_BEGIN_NAMESPACE
|
|||
This signal is emitted whenever QLocalSocket's state changes.
|
||||
The \a socketState parameter is the new state.
|
||||
|
||||
QLocalSocket::SocketState is not a registered metatype, so for queued
|
||||
connections, you will have to register it with Q_DECLARE_METATYPE() and
|
||||
qRegisterMetaType().
|
||||
|
||||
\sa state(), {Creating Custom Qt Types}
|
||||
*/
|
||||
|
||||
|
|
|
@ -23,14 +23,13 @@
|
|||
#define QLOCALSOCKET_H
|
||||
|
||||
#include <QtCore/qiodevice.h>
|
||||
#include <QtCore/qmetatype.h>
|
||||
#include <QtNetwork/qabstractsocket.h>
|
||||
|
||||
#ifndef QT_NO_LOCALSOCKET
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_LOCALSOCKET
|
||||
|
||||
class QLocalSocketPrivate;
|
||||
|
||||
class Q_NETWORK_EXPORT QLocalSocket : public QIODevice
|
||||
|
@ -118,9 +117,11 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug, QLocalSocket::LocalSocketError);
|
|||
Q_NETWORK_EXPORT QDebug operator<<(QDebug, QLocalSocket::LocalSocketState);
|
||||
#endif
|
||||
|
||||
#endif // QT_NO_LOCALSOCKET
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
Q_DECLARE_METATYPE(QLocalSocket::LocalSocketState);
|
||||
Q_DECLARE_METATYPE(QLocalSocket::LocalSocketError);
|
||||
|
||||
#endif // QT_NO_LOCALSOCKET
|
||||
|
||||
#endif // QLOCALSOCKET_H
|
||||
|
|
|
@ -49,6 +49,9 @@ QLocalSocketPrivate::QLocalSocketPrivate()
|
|||
|
||||
void QLocalSocketPrivate::init()
|
||||
{
|
||||
qRegisterMetaType<QLocalSocket::LocalSocketState>();
|
||||
qRegisterMetaType<QLocalSocket::LocalSocketError>();
|
||||
|
||||
Q_Q(QLocalSocket);
|
||||
// QIODevice signals
|
||||
q->connect(&unixSocket, SIGNAL(aboutToClose()), q, SIGNAL(aboutToClose()));
|
||||
|
|
Loading…
Add table
Reference in a new issue