Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qt6-webchannel for openSUSE:Factory checked in at 2026-08-21 16:51:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qt6-webchannel (Old) and /work/SRC/openSUSE:Factory/.qt6-webchannel.new.1258 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qt6-webchannel" Fri Aug 21 16:51:37 2026 rev:37 rq:1372270 version:6.11.2 Changes: -------- --- /work/SRC/openSUSE:Factory/qt6-webchannel/qt6-webchannel.changes 2026-05-28 17:26:34.966833851 +0200 +++ /work/SRC/openSUSE:Factory/.qt6-webchannel.new.1258/qt6-webchannel.changes 2026-08-21 16:52:31.651277343 +0200 @@ -1,0 +2,6 @@ +Tue Aug 18 11:49:36 UTC 2026 - Christophe Marin <[email protected]> + +- Update to 6.11.2 + https://www.qt.io/blog/qt-6.11.2-released + +------------------------------------------------------------------- Old: ---- qtwebchannel-everywhere-src-6.11.1.tar.xz New: ---- qtwebchannel-everywhere-src-6.11.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qt6-webchannel.spec ++++++ --- /var/tmp/diff_new_pack.rVrMlz/_old 2026-08-21 16:52:32.723315463 +0200 +++ /var/tmp/diff_new_pack.rVrMlz/_new 2026-08-21 16:52:32.725315534 +0200 @@ -16,7 +16,7 @@ # -%define real_version 6.11.1 +%define real_version 6.11.2 %define short_version 6.11 %define tar_name qtwebchannel-everywhere-src %define tar_suffix %{nil} @@ -27,7 +27,7 @@ %endif # Name: qt6-webchannel%{?pkg_suffix} -Version: 6.11.1 +Version: 6.11.2 Release: 0 Summary: Qt 6 WebChannel library License: GPL-2.0-only OR LGPL-3.0-only OR GPL-3.0-only ++++++ qtwebchannel-everywhere-src-6.11.1.tar.xz -> qtwebchannel-everywhere-src-6.11.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/.cmake.conf new/qtwebchannel-everywhere-src-6.11.2/.cmake.conf --- old/qtwebchannel-everywhere-src-6.11.1/.cmake.conf 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/.cmake.conf 2026-08-12 04:41:37.000000000 +0200 @@ -1,7 +1,8 @@ -set(QT_REPO_MODULE_VERSION "6.11.1") +set(QT_REPO_MODULE_VERSION "6.11.2") set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1") set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1" + "QT_NO_SINGLE_ARGUMENT_QHASH_OVERLOAD=1" "QT_NO_QASCONST=1" "QT_NO_URL_CAST_FROM_STRING=1" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/.tag new/qtwebchannel-everywhere-src-6.11.2/.tag --- old/qtwebchannel-everywhere-src-6.11.1/.tag 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/.tag 2026-08-12 04:41:37.000000000 +0200 @@ -1 +1 @@ -0c4b668118b29bbf59c9f05bfe147ff67bea9e63 +4d6a7ec14efc38ed09e55403b0843719539d162a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/dependencies.yaml new/qtwebchannel-everywhere-src-6.11.2/dependencies.yaml --- old/qtwebchannel-everywhere-src-6.11.1/dependencies.yaml 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/dependencies.yaml 2026-08-12 04:41:37.000000000 +0200 @@ -1,10 +1,10 @@ dependencies: ../qtbase: - ref: 59c81a3c2247b821b9b84b4eb8d939b77e07e276 + ref: ef55f427f2c8b410d34f8a7681020a3000cf6866 required: true ../qtdeclarative: - ref: a02bed441965ee1f18f856352c7d5ee5ba35d795 + ref: 4e3399c26ec57246c08de019cfcbda8d23604cfa required: false ../qtwebsockets: - ref: 451920600d7f0b8a4b458bba56a2dd303e587026 + ref: 3eab06de7076a83514e98c2403baa433d137b013 required: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/CMakeLists.txt new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/CMakeLists.txt --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/CMakeLists.txt 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/CMakeLists.txt 2026-08-12 04:41:37.000000000 +0200 @@ -1,8 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -qt_internal_add_example(shared) - qt_internal_add_example(nodejs) qt_internal_add_example(qwclient) qt_internal_add_example(chatclient-html) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatclient-html/doc/src/chatclient-html.qdoc new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatclient-html/doc/src/chatclient-html.qdoc --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatclient-html/doc/src/chatclient-html.qdoc 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatclient-html/doc/src/chatclient-html.qdoc 2026-08-12 04:41:37.000000000 +0200 @@ -10,6 +10,8 @@ \image chatclient-html.png + {Browser window with a Chat Login dialog containing a Name field + and Login button, beside a Users panel} \e{ChatClient HTML} provides a simple QWebChannel client implemented using JavaScript and HTML. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatclient-qml/doc/src/chatclient-qml.qdoc new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatclient-qml/doc/src/chatclient-qml.qdoc --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatclient-qml/doc/src/chatclient-qml.qdoc 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatclient-qml/doc/src/chatclient-qml.qdoc 2026-08-12 04:41:37.000000000 +0200 @@ -10,6 +10,8 @@ \meta tag {rpc,network} \image chatclient-qml.png + {Small Login window with a Login button in front of a Hello World + window} \e{ChatClient QML} provides a simple QWebChannel client implemented using JavaScript and QML. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/CMakeLists.txt new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/CMakeLists.txt --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/CMakeLists.txt 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/CMakeLists.txt 2026-08-12 04:41:37.000000000 +0200 @@ -13,8 +13,8 @@ find_package(Qt6 REQUIRED COMPONENTS Core WebChannel WebSockets) qt_add_executable(chatserver - ../shared/websocketclientwrapper.cpp ../shared/websocketclientwrapper.h - ../shared/websockettransport.cpp ../shared/websockettransport.h + websocketclientwrapper.cpp websocketclientwrapper.h + websockettransport.cpp websockettransport.h chatserver.cpp chatserver.h main.cpp ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/doc/src/chatserver-cpp.qdoc new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/doc/src/chatserver-cpp.qdoc --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/doc/src/chatserver-cpp.qdoc 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/doc/src/chatserver-cpp.qdoc 2026-08-12 04:41:37.000000000 +0200 @@ -9,6 +9,7 @@ \brief A simple chat server implemented using the QWebChannel C++ API. \image chatserver-cpp.png + {Console window printing repeated Keep Alive Check log lines} \e{ChatServer} provides a chat service that the \l{Qt WebChannel ChatClient QML Application} and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/main.cpp new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/main.cpp --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/main.cpp 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/main.cpp 2026-08-12 04:41:37.000000000 +0200 @@ -3,8 +3,8 @@ #include "chatserver.h" -#include "../shared/websocketclientwrapper.h" -#include "../shared/websockettransport.h" +#include "websocketclientwrapper.h" +#include "websockettransport.h" #include <QCoreApplication> #include <QWebChannel> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/websocketclientwrapper.cpp new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/websocketclientwrapper.cpp --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/websocketclientwrapper.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/websocketclientwrapper.cpp 2026-08-12 04:41:37.000000000 +0200 @@ -0,0 +1,37 @@ +// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "websocketclientwrapper.h" +#include "websockettransport.h" + +#include <QWebSocketServer> + +/*! + \brief Wraps connected QWebSockets clients in WebSocketTransport objects. + + This code is all that is required to connect incoming WebSockets to the WebChannel. Any kind + of remote JavaScript client that supports WebSockets can thus receive messages and access the + published objects. +*/ + +/*! + Construct the client wrapper with the given parent. + + All clients connecting to the QWebSocketServer will be automatically wrapped + in WebSocketTransport objects. +*/ +WebSocketClientWrapper::WebSocketClientWrapper(QWebSocketServer *server, QObject *parent) + : QObject(parent) + , m_server(server) +{ + connect(server, &QWebSocketServer::newConnection, + this, &WebSocketClientWrapper::handleNewConnection); +} + +/*! + Wrap an incoming WebSocket connection in a WebSocketTransport object. +*/ +void WebSocketClientWrapper::handleNewConnection() +{ + emit clientConnected(new WebSocketTransport(m_server->nextPendingConnection())); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/websocketclientwrapper.h new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/websocketclientwrapper.h --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/websocketclientwrapper.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/websocketclientwrapper.h 2026-08-12 04:41:37.000000000 +0200 @@ -0,0 +1,32 @@ +// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef WEBSOCKETCLIENTWRAPPER_H +#define WEBSOCKETCLIENTWRAPPER_H + +#include <QObject> + +class WebSocketTransport; + +QT_BEGIN_NAMESPACE +class QWebSocketServer; +QT_END_NAMESPACE + +class WebSocketClientWrapper : public QObject +{ + Q_OBJECT + +public: + WebSocketClientWrapper(QWebSocketServer *server, QObject *parent = nullptr); + +signals: + void clientConnected(WebSocketTransport *client); + +private slots: + void handleNewConnection(); + +private: + QWebSocketServer *m_server; +}; + +#endif // WEBSOCKETCLIENTWRAPPER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/websockettransport.cpp new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/websockettransport.cpp --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/websockettransport.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/websockettransport.cpp 2026-08-12 04:41:37.000000000 +0200 @@ -0,0 +1,67 @@ +// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "websockettransport.h" + +#include <QDebug> +#include <QJsonDocument> +#include <QJsonObject> +#include <QWebSocket> + +/*! + \brief QWebChannelAbstractSocket implementation that uses a QWebSocket internally. + + The transport delegates all messages received over the QWebSocket over its + textMessageReceived signal. Analogously, all calls to sendTextMessage will + be send over the QWebSocket to the remote client. +*/ + +/*! + Construct the transport object and wrap the given socket. + + The socket is also set as the parent of the transport object. +*/ +WebSocketTransport::WebSocketTransport(QWebSocket *socket) +: QWebChannelAbstractTransport(socket) +, m_socket(socket) +{ + connect(socket, &QWebSocket::textMessageReceived, + this, &WebSocketTransport::textMessageReceived); + connect(socket, &QWebSocket::disconnected, + this, &WebSocketTransport::deleteLater); +} + +/*! + Destroys the WebSocketTransport. +*/ +WebSocketTransport::~WebSocketTransport() +{ + m_socket->deleteLater(); +} + +/*! + Serialize the JSON message and send it as a text message via the WebSocket to the client. +*/ +void WebSocketTransport::sendMessage(const QJsonObject &message) +{ + QJsonDocument doc(message); + m_socket->sendTextMessage(QString::fromUtf8(doc.toJson(QJsonDocument::Compact))); +} + +/*! + Deserialize the stringified JSON messageData and emit messageReceived. +*/ +void WebSocketTransport::textMessageReceived(const QString &messageData) +{ + QJsonParseError error; + QJsonDocument message = QJsonDocument::fromJson(messageData.toUtf8(), &error); + if (error.error) { + qWarning() << "Failed to parse text message as JSON object:" << messageData + << "Error is:" << error.errorString(); + return; + } else if (!message.isObject()) { + qWarning() << "Received JSON message that is not an object: " << messageData; + return; + } + emit messageReceived(message.object(), this); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/websockettransport.h new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/websockettransport.h --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/chatserver-cpp/websockettransport.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/chatserver-cpp/websockettransport.h 2026-08-12 04:41:37.000000000 +0200 @@ -0,0 +1,29 @@ +// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef WEBSOCKETTRANSPORT_H +#define WEBSOCKETTRANSPORT_H + +#include <QWebChannelAbstractTransport> + +QT_BEGIN_NAMESPACE +class QWebSocket; +QT_END_NAMESPACE + +class WebSocketTransport : public QWebChannelAbstractTransport +{ + Q_OBJECT +public: + explicit WebSocketTransport(QWebSocket *socket); + virtual ~WebSocketTransport(); + + void sendMessage(const QJsonObject &message) override; + +private slots: + void textMessageReceived(const QString &message); + +private: + QWebSocket *m_socket; +}; + +#endif // WEBSOCKETTRANSPORT_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/CMakeLists.txt new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/CMakeLists.txt --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/CMakeLists.txt 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -# Empty file required for supporting installation of example sources. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/websocketclientwrapper.cpp new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/websocketclientwrapper.cpp --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/websocketclientwrapper.cpp 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/websocketclientwrapper.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,37 +0,0 @@ -// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include "websocketclientwrapper.h" -#include "websockettransport.h" - -#include <QWebSocketServer> - -/*! - \brief Wraps connected QWebSockets clients in WebSocketTransport objects. - - This code is all that is required to connect incoming WebSockets to the WebChannel. Any kind - of remote JavaScript client that supports WebSockets can thus receive messages and access the - published objects. -*/ - -/*! - Construct the client wrapper with the given parent. - - All clients connecting to the QWebSocketServer will be automatically wrapped - in WebSocketTransport objects. -*/ -WebSocketClientWrapper::WebSocketClientWrapper(QWebSocketServer *server, QObject *parent) - : QObject(parent) - , m_server(server) -{ - connect(server, &QWebSocketServer::newConnection, - this, &WebSocketClientWrapper::handleNewConnection); -} - -/*! - Wrap an incoming WebSocket connection in a WebSocketTransport object. -*/ -void WebSocketClientWrapper::handleNewConnection() -{ - emit clientConnected(new WebSocketTransport(m_server->nextPendingConnection())); -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/websocketclientwrapper.h new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/websocketclientwrapper.h --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/websocketclientwrapper.h 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/websocketclientwrapper.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,32 +0,0 @@ -// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#ifndef WEBSOCKETCLIENTWRAPPER_H -#define WEBSOCKETCLIENTWRAPPER_H - -#include <QObject> - -class WebSocketTransport; - -QT_BEGIN_NAMESPACE -class QWebSocketServer; -QT_END_NAMESPACE - -class WebSocketClientWrapper : public QObject -{ - Q_OBJECT - -public: - WebSocketClientWrapper(QWebSocketServer *server, QObject *parent = nullptr); - -signals: - void clientConnected(WebSocketTransport *client); - -private slots: - void handleNewConnection(); - -private: - QWebSocketServer *m_server; -}; - -#endif // WEBSOCKETCLIENTWRAPPER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/websockettransport.cpp new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/websockettransport.cpp --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/websockettransport.cpp 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/websockettransport.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,67 +0,0 @@ -// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include "websockettransport.h" - -#include <QDebug> -#include <QJsonDocument> -#include <QJsonObject> -#include <QWebSocket> - -/*! - \brief QWebChannelAbstractSocket implementation that uses a QWebSocket internally. - - The transport delegates all messages received over the QWebSocket over its - textMessageReceived signal. Analogously, all calls to sendTextMessage will - be send over the QWebSocket to the remote client. -*/ - -/*! - Construct the transport object and wrap the given socket. - - The socket is also set as the parent of the transport object. -*/ -WebSocketTransport::WebSocketTransport(QWebSocket *socket) -: QWebChannelAbstractTransport(socket) -, m_socket(socket) -{ - connect(socket, &QWebSocket::textMessageReceived, - this, &WebSocketTransport::textMessageReceived); - connect(socket, &QWebSocket::disconnected, - this, &WebSocketTransport::deleteLater); -} - -/*! - Destroys the WebSocketTransport. -*/ -WebSocketTransport::~WebSocketTransport() -{ - m_socket->deleteLater(); -} - -/*! - Serialize the JSON message and send it as a text message via the WebSocket to the client. -*/ -void WebSocketTransport::sendMessage(const QJsonObject &message) -{ - QJsonDocument doc(message); - m_socket->sendTextMessage(QString::fromUtf8(doc.toJson(QJsonDocument::Compact))); -} - -/*! - Deserialize the stringified JSON messageData and emit messageReceived. -*/ -void WebSocketTransport::textMessageReceived(const QString &messageData) -{ - QJsonParseError error; - QJsonDocument message = QJsonDocument::fromJson(messageData.toUtf8(), &error); - if (error.error) { - qWarning() << "Failed to parse text message as JSON object:" << messageData - << "Error is:" << error.errorString(); - return; - } else if (!message.isObject()) { - qWarning() << "Received JSON message that is not an object: " << messageData; - return; - } - emit messageReceived(message.object(), this); -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/websockettransport.h new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/websockettransport.h --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/shared/websockettransport.h 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/shared/websockettransport.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,29 +0,0 @@ -// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#ifndef WEBSOCKETTRANSPORT_H -#define WEBSOCKETTRANSPORT_H - -#include <QWebChannelAbstractTransport> - -QT_BEGIN_NAMESPACE -class QWebSocket; -QT_END_NAMESPACE - -class WebSocketTransport : public QWebChannelAbstractTransport -{ - Q_OBJECT -public: - explicit WebSocketTransport(QWebSocket *socket); - virtual ~WebSocketTransport(); - - void sendMessage(const QJsonObject &message) override; - -private slots: - void textMessageReceived(const QString &message); - -private: - QWebSocket *m_socket; -}; - -#endif // WEBSOCKETTRANSPORT_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/CMakeLists.txt new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/CMakeLists.txt --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/CMakeLists.txt 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/CMakeLists.txt 2026-08-12 04:41:37.000000000 +0200 @@ -10,8 +10,8 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui WebChannel WebSockets Widgets) qt_add_executable(standalone - ../shared/websocketclientwrapper.cpp ../shared/websocketclientwrapper.h - ../shared/websockettransport.cpp ../shared/websockettransport.h + websocketclientwrapper.cpp websocketclientwrapper.h + websockettransport.cpp websockettransport.h core.h dialog.cpp dialog.h dialog.ui main.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/doc/src/standalone.qdoc new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/doc/src/standalone.qdoc --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/doc/src/standalone.qdoc 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/doc/src/standalone.qdoc 2026-08-12 04:41:37.000000000 +0200 @@ -6,6 +6,9 @@ \title Qt WebChannel Standalone Example \ingroup qtwebchannel-examples \image standalone-screenshot.png + {Dialog window listing exchanged ping and pong messages with an + input field and Send button, over a terminal showing connection + log output} \examplecategory {Web Technologies} \brief A simple chat between a server and a remote client running in a browser. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/main.cpp new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/main.cpp --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/main.cpp 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/main.cpp 2026-08-12 04:41:37.000000000 +0200 @@ -3,8 +3,8 @@ #include "dialog.h" #include "core.h" -#include "../shared/websocketclientwrapper.h" -#include "../shared/websockettransport.h" +#include "websocketclientwrapper.h" +#include "websockettransport.h" #include <QApplication> #include <QDesktopServices> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/websocketclientwrapper.cpp new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/websocketclientwrapper.cpp --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/websocketclientwrapper.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/websocketclientwrapper.cpp 2026-08-12 04:41:37.000000000 +0200 @@ -0,0 +1,37 @@ +// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "websocketclientwrapper.h" +#include "websockettransport.h" + +#include <QWebSocketServer> + +/*! + \brief Wraps connected QWebSockets clients in WebSocketTransport objects. + + This code is all that is required to connect incoming WebSockets to the WebChannel. Any kind + of remote JavaScript client that supports WebSockets can thus receive messages and access the + published objects. +*/ + +/*! + Construct the client wrapper with the given parent. + + All clients connecting to the QWebSocketServer will be automatically wrapped + in WebSocketTransport objects. +*/ +WebSocketClientWrapper::WebSocketClientWrapper(QWebSocketServer *server, QObject *parent) + : QObject(parent) + , m_server(server) +{ + connect(server, &QWebSocketServer::newConnection, + this, &WebSocketClientWrapper::handleNewConnection); +} + +/*! + Wrap an incoming WebSocket connection in a WebSocketTransport object. +*/ +void WebSocketClientWrapper::handleNewConnection() +{ + emit clientConnected(new WebSocketTransport(m_server->nextPendingConnection())); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/websocketclientwrapper.h new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/websocketclientwrapper.h --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/websocketclientwrapper.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/websocketclientwrapper.h 2026-08-12 04:41:37.000000000 +0200 @@ -0,0 +1,32 @@ +// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef WEBSOCKETCLIENTWRAPPER_H +#define WEBSOCKETCLIENTWRAPPER_H + +#include <QObject> + +class WebSocketTransport; + +QT_BEGIN_NAMESPACE +class QWebSocketServer; +QT_END_NAMESPACE + +class WebSocketClientWrapper : public QObject +{ + Q_OBJECT + +public: + WebSocketClientWrapper(QWebSocketServer *server, QObject *parent = nullptr); + +signals: + void clientConnected(WebSocketTransport *client); + +private slots: + void handleNewConnection(); + +private: + QWebSocketServer *m_server; +}; + +#endif // WEBSOCKETCLIENTWRAPPER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/websockettransport.cpp new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/websockettransport.cpp --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/websockettransport.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/websockettransport.cpp 2026-08-12 04:41:37.000000000 +0200 @@ -0,0 +1,67 @@ +// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "websockettransport.h" + +#include <QDebug> +#include <QJsonDocument> +#include <QJsonObject> +#include <QWebSocket> + +/*! + \brief QWebChannelAbstractSocket implementation that uses a QWebSocket internally. + + The transport delegates all messages received over the QWebSocket over its + textMessageReceived signal. Analogously, all calls to sendTextMessage will + be send over the QWebSocket to the remote client. +*/ + +/*! + Construct the transport object and wrap the given socket. + + The socket is also set as the parent of the transport object. +*/ +WebSocketTransport::WebSocketTransport(QWebSocket *socket) +: QWebChannelAbstractTransport(socket) +, m_socket(socket) +{ + connect(socket, &QWebSocket::textMessageReceived, + this, &WebSocketTransport::textMessageReceived); + connect(socket, &QWebSocket::disconnected, + this, &WebSocketTransport::deleteLater); +} + +/*! + Destroys the WebSocketTransport. +*/ +WebSocketTransport::~WebSocketTransport() +{ + m_socket->deleteLater(); +} + +/*! + Serialize the JSON message and send it as a text message via the WebSocket to the client. +*/ +void WebSocketTransport::sendMessage(const QJsonObject &message) +{ + QJsonDocument doc(message); + m_socket->sendTextMessage(QString::fromUtf8(doc.toJson(QJsonDocument::Compact))); +} + +/*! + Deserialize the stringified JSON messageData and emit messageReceived. +*/ +void WebSocketTransport::textMessageReceived(const QString &messageData) +{ + QJsonParseError error; + QJsonDocument message = QJsonDocument::fromJson(messageData.toUtf8(), &error); + if (error.error) { + qWarning() << "Failed to parse text message as JSON object:" << messageData + << "Error is:" << error.errorString(); + return; + } else if (!message.isObject()) { + qWarning() << "Received JSON message that is not an object: " << messageData; + return; + } + emit messageReceived(message.object(), this); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/websockettransport.h new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/websockettransport.h --- old/qtwebchannel-everywhere-src-6.11.1/examples/webchannel/standalone/websockettransport.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtwebchannel-everywhere-src-6.11.2/examples/webchannel/standalone/websockettransport.h 2026-08-12 04:41:37.000000000 +0200 @@ -0,0 +1,29 @@ +// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Milian Wolff <[email protected]> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef WEBSOCKETTRANSPORT_H +#define WEBSOCKETTRANSPORT_H + +#include <QWebChannelAbstractTransport> + +QT_BEGIN_NAMESPACE +class QWebSocket; +QT_END_NAMESPACE + +class WebSocketTransport : public QWebChannelAbstractTransport +{ + Q_OBJECT +public: + explicit WebSocketTransport(QWebSocket *socket); + virtual ~WebSocketTransport(); + + void sendMessage(const QJsonObject &message) override; + +private slots: + void textMessageReceived(const QString &message); + +private: + QWebSocket *m_socket; +}; + +#endif // WEBSOCKETTRANSPORT_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtwebchannel-everywhere-src-6.11.1/src/webchannel/doc/qtwebchannel.qdocconf new/qtwebchannel-everywhere-src-6.11.2/src/webchannel/doc/qtwebchannel.qdocconf --- old/qtwebchannel-everywhere-src-6.11.1/src/webchannel/doc/qtwebchannel.qdocconf 2026-05-08 04:06:37.000000000 +0200 +++ new/qtwebchannel-everywhere-src-6.11.2/src/webchannel/doc/qtwebchannel.qdocconf 2026-08-12 04:41:37.000000000 +0200 @@ -50,6 +50,9 @@ imagedirs += images +# Report warnings for images without alt text +reportmissingalttextforimages = true + exampledirs += ../../../examples/webchannel examples.fileextensions += "*.html *.json"
