diff options
author | Kurt Pattyn <pattyn.kurt@gmail.com> | 2014-01-18 21:16:23 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-20 16:49:15 +0100 |
commit | 9373258b80983bf8f45c98628b08e02adf25edf3 (patch) | |
tree | 3b2ee4785d674e15b9f08f7812441788e85d45f5 /examples/echoclient | |
parent | 1941de4eaff86a096b1720ad10fa5a633bf77243 (diff) | |
download | qtwebsockets-9373258b80983bf8f45c98628b08e02adf25edf3.tar.gz |
Use new connect syntax
Change-Id: I0b48c6cba12902d910c4f586fa105a13d084a437
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'examples/echoclient')
-rw-r--r-- | examples/echoclient/echoclient.cpp | 8 | ||||
-rw-r--r-- | examples/echoclient/main.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/echoclient/echoclient.cpp b/examples/echoclient/echoclient.cpp index f7ffae3..1ea3006 100644 --- a/examples/echoclient/echoclient.cpp +++ b/examples/echoclient/echoclient.cpp @@ -49,8 +49,8 @@ EchoClient::EchoClient(const QUrl &url, QObject *parent) : m_webSocket(), m_url(url) { - connect(&m_webSocket, SIGNAL(connected()), this, SLOT(onConnected())); - connect(&m_webSocket, SIGNAL(disconnected()), this, SIGNAL(closed())); + connect(&m_webSocket, &QWebSocket::connected, this, &EchoClient::onConnected); + connect(&m_webSocket, &QWebSocket::disconnected, this, &EchoClient::closed); m_webSocket.open(QUrl(url)); } //! [constructor] @@ -59,8 +59,8 @@ EchoClient::EchoClient(const QUrl &url, QObject *parent) : void EchoClient::onConnected() { qDebug() << "Websocket connected"; - connect(&m_webSocket, SIGNAL(textMessageReceived(QString)), this, - SLOT(onTextMessageReceived(QString))); + connect(&m_webSocket, &QWebSocket::textMessageReceived, + this, &EchoClient::onTextMessageReceived); m_webSocket.write("Hello, world!"); } //! [onConnected] diff --git a/examples/echoclient/main.cpp b/examples/echoclient/main.cpp index a13097d..e6a3a5d 100644 --- a/examples/echoclient/main.cpp +++ b/examples/echoclient/main.cpp @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); EchoClient client(QUrl("ws://localhost:1234")); - QObject::connect(&client, SIGNAL(closed()), &a, SLOT(quit())); + QObject::connect(&client, &EchoClient::closed, &a, &QCoreApplication::quit); Q_UNUSED(client); |