| CMakeLists.txt |
|
1798 |
- |
| doc |
|
|
- |
| qmetaobjectpublisher.cpp |
|
48670 |
- |
| qmetaobjectpublisher_p.h |
Register @p object under the given @p id.
The properties, signals and public methods of the QObject are
published to the remote client, where an object with the given identifier
is constructed.
TODO: This must be called, before clients are initialized.
|
15355 |
- |
| Qt6WebChannelExtras.cmake.in |
|
224 |
- |
| qwebchannel.cpp |
!
\class QWebChannel
\inmodule QtWebChannel
\brief Exposes QObjects to remote HTML clients.
\since 5.4
The QWebChannel fills the gap between C++ applications and HTML/JavaScript
applications. By publishing a QObject derived object to a QWebChannel and
using the \l{Qt WebChannel JavaScript API}{qwebchannel.js} on the HTML side, one can transparently access
properties and public slots and methods of the QObject. No manual message
passing and serialization of data is required, property updates and signal emission
on the C++ side get automatically transmitted to the potentially remotely running HTML clients.
On the client side, a JavaScript object will be created for any published C++ QObject. It mirrors the
C++ object's API and thus is intuitively useable.
QWebChannel transparently supports QFuture. When a client calls a method that returns a QFuture,
QWebChannel will send a response with the QFuture result only after the QFuture has finished.
Custom conversion of types to and from JSON is supported by defining converters with
QMetaType::registerConverter() to and from QJsonValue. Note that custom converters from QJsonValue to a concrete
type must fail if the QJsonValue does not match the expected format. Otherwise QWebChannel cannot fall back to its
default conversion mechanisms.
Custom converters are also available on \l{Qt WebChannel JavaScript API}{the JavaScript side}.
The C++ QWebChannel API makes it possible to talk to any HTML client, which could run on a local
or even remote machine. The only limitation is that the HTML client supports the JavaScript
features used by \c{qwebchannel.js}. As such, one can interact
with basically any modern HTML browser or standalone JavaScript runtime, such as node.js.
There also exists a declarative \l{Qt WebChannel QML Types}{WebChannel API}.
\sa {Qt WebChannel Standalone Example}, {Qt WebChannel JavaScript API}{JavaScript API},
QMetaType::registerConverter()
|
11160 |
- |
| qwebchannel.h |
|
2167 |
- |
| qwebchannel.js |
|
16054 |
- |
| qwebchannel_p.h |
|
1091 |
- |
| qwebchannelabstracttransport.cpp |
!
\class QWebChannelAbstractTransport
\inmodule QtWebChannel
\brief Communication channel between the C++ QWebChannel server and a HTML/JS client.
\since 5.4
Users of the QWebChannel must implement this interface and connect instances of it
to the QWebChannel server for every client that should be connected to the QWebChannel.
The \l{Qt WebChannel Standalone Example} shows how this can be done
using \l{Qt WebSockets}.
\note The JSON message protocol is considered internal and might change over time.
\sa {Qt WebChannel Standalone Example}
|
1770 |
- |
| qwebchannelabstracttransport.h |
|
934 |
- |
| qwebchannelglobal.h |
|
432 |
- |
| signalhandler_p.h |
The signal handler is similar to QSignalSpy, but geared towards the usecase of the web channel.
It allows connecting to any number of signals of arbitrary objects and forwards the signal
invocations to the Receiver by calling its signalEmitted function, which takes the object,
signal index and a QVariantList of arguments.
|
9561 |
- |