diff options
author | Liang Qi <liang.qi@qt.io> | 2020-02-13 09:14:09 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-02-13 18:31:40 +0100 |
commit | 6b2535ea15cdbdb2355416b604f072fc13ff36b2 (patch) | |
tree | 4bf1560bab77c8b315850c5337ba31a0ea87b5f0 /src/network/socket/qlocalsocket.cpp | |
parent | 54c2cebabdda0280b8443c6947b6fee02445e138 (diff) | |
parent | 67491e2df5357706dbf88ddaf1f030ff095b4528 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
examples/widgets/graphicsview/boxes/scene.h
src/corelib/Qt5CoreMacros.cmake
src/corelib/Qt6CoreMacros.cmake
src/network/ssl/qsslsocket.cpp
src/network/ssl/qsslsocket.h
src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
src/testlib/CMakeLists.txt
src/testlib/.prev_CMakeLists.txt
tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
Disabled building manual tests with CMake for now, because qmake
doesn't do it, and it confuses people.
Done-With: Alexandru Croitor <alexandru.croitor@qt.io>
Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
Diffstat (limited to 'src/network/socket/qlocalsocket.cpp')
-rw-r--r-- | src/network/socket/qlocalsocket.cpp | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp index d517f91aad..38e47d6e26 100644 --- a/src/network/socket/qlocalsocket.cpp +++ b/src/network/socket/qlocalsocket.cpp @@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE The socket is opened in the given \a openMode and first enters ConnectingState. If a connection is established, QLocalSocket enters ConnectedState and emits connected(). - After calling this function, the socket can emit error() to signal that an error occurred. + After calling this function, the socket can emit errorOccurred() to signal that an error occurred. \sa state(), serverName(), waitForConnected() */ @@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE Note that unlike in most other QIODevice subclasses, open() may not open the device directly. The function return false if the socket was already connected or if the server to connect - to was not defined and true in any other case. The connected() or error() signals will be + to was not defined and true in any other case. The connected() or errorOccurred() signals will be emitted once the device is actualy open (or the connection failed). See connectToServer() for more details. @@ -220,25 +220,11 @@ QT_BEGIN_NAMESPACE /*! \fn QLocalSocket::LocalSocketError QLocalSocket::error() const - \deprecated - - Use socketError() instead. - - Returns the type of error that last occurred. - - \sa state(), errorString(), socketError() -*/ - -/*! - \fn QLocalSocket::LocalSocketError QLocalSocket::socketError() const - \since 5.15 - Returns the type of error that last occurred. \sa state(), errorString() */ - /*! \fn bool QLocalSocket::isValid() const @@ -286,7 +272,7 @@ QT_BEGIN_NAMESPACE Waits until the socket is connected, up to \a msecs milliseconds. If the connection has been established, this function returns \c true; otherwise it returns \c false. In the case where it returns \c false, you can call - socketError() to determine the cause of the error. + error() to determine the cause of the error. The following example waits up to one second for a connection to be established: @@ -305,7 +291,7 @@ QT_BEGIN_NAMESPACE connection was successfully disconnected, this function returns \c true; otherwise it returns \c false (if the operation timed out, if an error occurred, or if this QLocalSocket is already disconnected). In the case - where it returns \c false, you can call socketError() to determine the cause of + where it returns \c false, you can call error() to determine the cause of the error. The following example waits up to one second for a connection @@ -343,6 +329,14 @@ QT_BEGIN_NAMESPACE /*! \fn void QLocalSocket::error(QLocalSocket::LocalSocketError socketError) + \obsolete + + Use errorOccurred() instead. +*/ + +/*! + \fn void QLocalSocket::errorOccurred(QLocalSocket::LocalSocketError socketError) + \since 5.15 This signal is emitted after an error occurred. The \a socketError parameter describes the type of error that occurred. @@ -351,7 +345,7 @@ QT_BEGIN_NAMESPACE connections, you will have to register it with Q_DECLARE_METATYPE() and qRegisterMetaType(). - \sa socketError(), errorString(), {Creating Custom Qt Types} + \sa error(), errorString(), {Creating Custom Qt Types} */ /*! @@ -376,6 +370,9 @@ QLocalSocket::QLocalSocket(QObject * parent) { Q_D(QLocalSocket); d->init(); + + // Support the deprecated error() signal: + connect(this, &QLocalSocket::errorOccurred, this, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error)); } /*! @@ -403,7 +400,7 @@ bool QLocalSocket::open(OpenMode openMode) The socket is opened in the given \a openMode and first enters ConnectingState. If a connection is established, QLocalSocket enters ConnectedState and emits connected(). - After calling this function, the socket can emit error() to signal that an error occurred. + After calling this function, the socket can emit errorOccurred() to signal that an error occurred. \sa state(), serverName(), waitForConnected() */ @@ -460,7 +457,7 @@ QString QLocalSocket::fullServerName() const /*! Returns the state of the socket. - \sa socketError() + \sa error() */ QLocalSocket::LocalSocketState QLocalSocket::state() const { @@ -480,7 +477,7 @@ bool QLocalSocket::isSequential() const The LocalServerError enumeration represents the errors that can occur. The most recent error can be retrieved through a call to - \l QLocalSocket::socketError(). + \l QLocalSocket::error(). \value ConnectionRefusedError The connection was refused by the peer (or timed out). |