summaryrefslogtreecommitdiff
path: root/examples/websockets
diff options
context:
space:
mode:
Diffstat (limited to 'examples/websockets')
-rw-r--r--examples/websockets/simplechat/chatserver.cpp3
-rw-r--r--examples/websockets/websockets.pro1
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/websockets/simplechat/chatserver.cpp b/examples/websockets/simplechat/chatserver.cpp
index 5a0c998..ae207f5 100644
--- a/examples/websockets/simplechat/chatserver.cpp
+++ b/examples/websockets/simplechat/chatserver.cpp
@@ -93,8 +93,7 @@ void ChatServer::onNewConnection()
void ChatServer::processMessage(QString message)
{
QWebSocket *pSender = qobject_cast<QWebSocket *>(sender());
- Q_FOREACH (QWebSocket *pClient, m_clients)
- {
+ for (QWebSocket *pClient : qAsConst(m_clients)) {
if (pClient != pSender) //don't echo message back to sender
{
pClient->sendTextMessage(message);
diff --git a/examples/websockets/websockets.pro b/examples/websockets/websockets.pro
index 8ad9645..fa6c0c0 100644
--- a/examples/websockets/websockets.pro
+++ b/examples/websockets/websockets.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += network
SUBDIRS = echoclient \
echoserver \