aboutsummaryrefslogtreecommitdiffstats
path: root/examples/websockets/simplechat
diff options
context:
space:
mode:
Diffstat (limited to 'examples/websockets/simplechat')
-rw-r--r--examples/websockets/simplechat/chatserver.cpp3
1 files changed, 1 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);