diff options
Diffstat (limited to 'src/webchannel/doc')
-rw-r--r-- | src/webchannel/doc/qtwebchannel.qdocconf | 3 | ||||
-rw-r--r-- | src/webchannel/doc/src/examples.qdoc | 3 | ||||
-rw-r--r-- | src/webchannel/doc/src/external-resources.qdoc | 57 | ||||
-rw-r--r-- | src/webchannel/doc/src/index.qdoc | 42 | ||||
-rw-r--r-- | src/webchannel/doc/src/javascript.qdoc | 17 |
5 files changed, 102 insertions, 20 deletions
diff --git a/src/webchannel/doc/qtwebchannel.qdocconf b/src/webchannel/doc/qtwebchannel.qdocconf index cfb47e4..4026379 100644 --- a/src/webchannel/doc/qtwebchannel.qdocconf +++ b/src/webchannel/doc/qtwebchannel.qdocconf @@ -40,7 +40,7 @@ qhp.QtWebChannel.subprojects.javascript.indexTitle = Qt WebChannel JavaScript tagfile = ../../../doc/qtwebchannel/qtwebchannel.tags -depends += qtcore qtquick qtqml qmake qtdoc +depends += qtcore qtquick qtqml qmake qtdoc qtwebengine qtwebsockets headerdirs += .. \ ../../imports @@ -48,6 +48,7 @@ headerdirs += .. \ sourcedirs += .. \ ../../imports +imagedirs += images exampledirs += ../../../examples/webchannel examples.fileextensions += "*.html *.json" diff --git a/src/webchannel/doc/src/examples.qdoc b/src/webchannel/doc/src/examples.qdoc index b304ac6..83e614e 100644 --- a/src/webchannel/doc/src/examples.qdoc +++ b/src/webchannel/doc/src/examples.qdoc @@ -42,6 +42,7 @@ \group qtwebchannel-examples \brief List of Qt WebChannel examples. - The examples show how to use the QWebChannel C++ and WebChannel QML API. + The examples show how to use the QWebChannel C++ and \l [QML] WebChannel QML + API. */ diff --git a/src/webchannel/doc/src/external-resources.qdoc b/src/webchannel/doc/src/external-resources.qdoc new file mode 100644 index 0000000..0002ec1 --- /dev/null +++ b/src/webchannel/doc/src/external-resources.qdoc @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* + The nolink entries prevent autolinking of each occurrence of 'WebChannel' + 'WebEngine' or 'WebSocket' to the QML type. + To link to the QML type, use explicit linking. For example: + \l [QML] WebChannel + \sa {QtWebChannel::}{WebChannel} +*/ +/*! + \externalpage nolink + \title WebChannel + \internal +*/ + +/*! + \externalpage nolink + \title WebEngine + \internal +*/ + +/*! + \externalpage nolink + \title WebSockets + \internal +*/ + +/*! + \externalpage nolink + \title WebSocket + \internal +*/ diff --git a/src/webchannel/doc/src/index.qdoc b/src/webchannel/doc/src/index.qdoc index a4eaad0..5529093 100644 --- a/src/webchannel/doc/src/index.qdoc +++ b/src/webchannel/doc/src/index.qdoc @@ -31,25 +31,49 @@ \title Qt WebChannel \brief Bridges the gap between Qt applications and HTML/JavaScript. - Qt WebChannel enables peer-to-peer communication between a host - (QML/C++ application) and a client (HTML/JavaScript application). - It is supported out of the box by Qt WebKit 2 and Qt WebEngine. - In addition it can work on all - browsers that support WebSockets, enabling Qt WebChannel clients - to run in any JavaScript environment (including QML). This requires + Qt WebChannel enables peer-to-peer communication between a server (QML/C++ + application) and a client (HTML/JavaScript or QML application). It is + supported out of the box by \l{Qt WebEngine}. In addition it can work on all + browsers that support \l{Qt WebSockets}{WebSockets}, enabling Qt WebChannel + clients to run in any JavaScript environment (including QML). This requires the implementation of a custom transport based on Qt WebSockets. 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 |