diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2016-07-15 21:24:23 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2016-07-15 21:24:23 +0200 |
commit | 3836fd7d12777fc53836a72d6542d2fbf2f20ac9 (patch) | |
tree | ffd8a3d1c82fea142d7b50fb42111ceb1fbc2e1a /src/webchannel/doc/src | |
parent | b84f22a3249aa1af46b17e33ac030abb077251bf (diff) | |
parent | e35346cf70598c47a456946327927643910aa277 (diff) | |
download | qtwebchannel-3836fd7d12777fc53836a72d6542d2fbf2f20ac9.tar.gz |
Merge remote-tracking branch 'origin/5.6' into 5.7
Alleged Conflicts:
examples/webchannel/chatclient-html/doc/src/chatclient-html.qdoc
examples/webchannel/chatclient-qml/doc/src/chatclient-qml.qdoc
examples/webchannel/chatserver-cpp/doc/src/chatserver-cpp.qdoc
In each case, the two sides agreed byte-for-byte.
Not quite sure what git thought the conflict was !
Change-Id: I5da9695b667f4112848c520b630ab1304d61cea3
Diffstat (limited to 'src/webchannel/doc/src')
-rw-r--r-- | src/webchannel/doc/src/index.qdoc | 40 | ||||
-rw-r--r-- | src/webchannel/doc/src/javascript.qdoc | 17 |
2 files changed, 40 insertions, 17 deletions
diff --git a/src/webchannel/doc/src/index.qdoc b/src/webchannel/doc/src/index.qdoc index 5f354bd..43f4e6f 100644 --- a/src/webchannel/doc/src/index.qdoc +++ b/src/webchannel/doc/src/index.qdoc @@ -31,26 +31,50 @@ \title Qt WebChannel \brief Bridges the gap between Qt applications and HTML/JavaScript. - Qt WebChannel enables peer-to-peer communication between the host - (QML/C++ application) and the client (HTML/JavaScript application). The - transport mechanism is supported out of the box by the two popular web - engines, Qt WebKit 2 and Qt WebEngine (experimental). It works on all - browsers that support Qt WebSockets, enabling Qt WebChannel applications + Qt WebChannel enables peer-to-peer communication between the server + (QML/C++ application) and the client (HTML/JavaScript or QML application). The + transport mechanism is supported out of the box by \l{Qt WebEngine}. It works on all + browsers that support \l{Qt WebSockets}, enabling Qt WebChannel applications to run in any JavaScript runtime. Additionally, a custom transport mechanism can also be implemented using Qt WebSockets to support Qt WebChannel-based communication. The module provides a JavaScript library for seamless integration of C++ - and QML applications with HTML/JavaScript clients. The client must use the + and QML applications with HTML/JavaScript and QML clients. The clients must use the JavaScript library to access the serialized QObjects published by the host applications. - \section1 Related Information + \section1 Getting Started + + To use these classes in your application, use the following include + statement: + + \code + #include <QtWebChannel/QtWebChannel> + \endcode + + To link against the module, add this line to your \l qmake \c .pro file: + + \code + QT += webchannel + \endcode + + The QML types are accessed by using: + \badcode + import QtWebChannel 1.0 + \endcode + + \section1 API Reference \list \li \l{Qt WebChannel JavaScript API}{JavaScript API} \li \l{Qt WebChannel C++ Classes}{C++ API} \li \l{Qt WebChannel QML Types}{QML API} - \li \l{Qt WebChannel Examples}{Examples} - show how use the API in practice + \endlist + + \section1 Examples + + \list + \li \l{Qt WebChannel Examples}{Examples} \endlist */ 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 |