diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2016-07-20 16:27:47 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2016-07-21 16:44:49 +0200 |
commit | 91ebebdbf26907c126dcc367832ed524d64b94cf (patch) | |
tree | d9d4fee39a1fa88a2eb8ff90bcde6ec248550311 /src/webchannel/doc/src/javascript.qdoc | |
parent | fa2374d7c4dedea907e2df26fdad28bdee73b122 (diff) | |
parent | 3836fd7d12777fc53836a72d6542d2fbf2f20ac9 (diff) | |
download | qtwebchannel-91ebebdbf26907c126dcc367832ed524d64b94cf.tar.gz |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
src/webchannel/doc/src/index.qdoc
src/webchannel/qwebchannelabstracttransport.cpp
Overlapping changes to documentation; constructed hybrid.
src/webchannel/qmetaobjectpublisher.cpp
tests/auto/webchannel/tst_webchannel.cpp
tests/auto/webchannel/tst_webchannel.h
Both sides made additions; in the same place.
Change-Id: Iff12970978b70946dc3e1290841aca2d35c9c1d0
Diffstat (limited to 'src/webchannel/doc/src/javascript.qdoc')
-rw-r--r-- | src/webchannel/doc/src/javascript.qdoc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/webchannel/doc/src/javascript.qdoc b/src/webchannel/doc/src/javascript.qdoc index cfb5b21..a508ff9 100644 --- a/src/webchannel/doc/src/javascript.qdoc +++ b/src/webchannel/doc/src/javascript.qdoc @@ -31,21 +31,20 @@ \brief This page explains how to use the JavaScript QWebChannel API in HTML clients. - \section1 Setup + \section1 Setting up the JavaScript API - To communicate with a QWebChannel or WebChannel, any HTML client must use and setup the - JavaScript API provided by \c qwebchannel.js. For HTML clients run inside Qt WebKit, you - can load the file via \c qrc:///qtwebchannel/qwebchannel.js. For external clients you will - need to copy the file to your webserver. Then instantiate a QWebChannel object and pass + To communicate with a QWebChannel or \l [QML] WebChannel, a client must use and set up the + JavaScript API provided by \c qwebchannel.js. For clients run inside \l{Qt WebEngine}, you + can load the file via \c qrc:///qtwebchannel/qwebchannel.js. For external clients, you + need to copy the file to your web server. Then instantiate a QWebChannel object and pass it a transport object and a callback function, which will be invoked once the - initialization of the channel finished and published objects become available. + initialization of the channel finishes and the published objects become available. The transport object implements a minimal message passing interface. It should be an object with a \c send() function, which takes a stringified JSON message and transmits it to the server-side QWebChannelAbstractTransport object. Furthermore, its \c onmessage property should - be called when a message from the server was received. This interface is implemented internally - by the Qt WebKit navigator.qtWebChannelTransport object. Alternatively, you can also use a - WebSocket, which also implements this interface. + be called when a message from the server was received. Alternatively, you can use a + \l{Qt WebSockets}{WebSocket} to implement the interface. Note that the JavaScript QWebChannel object should be constructed once the transport object is fully operational. In case of a WebSocket, that means you should create the QWebChannel in the |