aboutsummaryrefslogtreecommitdiffstats
path: root/src/webchannel/qwebchannel.h
Commit message (Collapse)AuthorAgeFilesLines
* QWebChannel: give friendship to tst_bench_QWebChannel the idiomatic wayMarc Mutz2024-03-011-1/+3
| | | | | | | | | | | | | | | | | | | | Don't put the tst_ class into the QT_NAMESPACE lest it changes the name in the CI -qt-namespace builds and messes up statistics (unlikely, being a benchmark, but anyway). This requires forward-declaring the tst_ class at global scope and using a FQN in the friend declaration to avoid the friend declaration declaring a separate class in QT_NAMESPACE. Amends dccba9bbfdb893fb51c7ef52b7cf0e605eb2d13d, but that just inherited the issue from the existing code. Created QTBUG-122927 to track the original issue. Task-number: QTBUG-122927 Pick-to: 6.7 Change-Id: Ia6d3932f061eee7b6741ac875932a7e15120d830 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Cleanup: move QWebChannel benchmarks into a separate subdirectoryIvan Solovev2023-10-161-0/+1
| | | | | | | | | | | | | Benchmarks should not be a part of common test-cases. We normally have a different tests/benchmarks subdirectory for them. This commit moves benchmarks from tst_webchannel into a new benchmark. This requires defining a new class as a friend of QWebChannel and QMetaObjectPublisher. Change-Id: I4b5b182d5c25648d0bc6ac46e1415f9742b9ff37 Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Use SPDX license identifiersLucie Gérard2022-06-101-39/+3
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: Id704376bd7d5a127ad3e9bf09f9abedcf2b0f498 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Make blockUpdates bindableØystein Heskestad2021-05-201-1/+3
| | | | | | | | [ChangeLog] Make blockUpdates bindable Task-number: QTBUG-93601 Change-Id: I7a5e06ecb3258b11988343321b78ffaab1d48dc0 Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Make property update interval configurable and add testsØystein Heskestad2021-05-051-1/+6
| | | | | | | | [ChangeLog] Make the property update interval configurable Fixes: QTBUG-92928 Change-Id: I0b02ae0c0879c1a3891d5807c1ff8c1f619841b2 Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Replace Q_NULLPTR with nullptr and fix a warningØystein Heskestad2021-03-231-2/+2
| | | | | | | | * The warning was that a QJsonValue reference was used when iterating over a QJsonArray Task-number: QTBUG-91757 Change-Id: I72fefb0b1d119da565b6dd1bcbada4fa874fd94e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-beta1Liang Qi2016-03-071-2/+2
|\ | | | | | | Change-Id: Ifb2b9cc762b5c75f1ec3bf47c607906fdfef9bd1
| * Make public headers compile with -Wzero-as-null-pointer-constantMarc Mutz2016-03-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | ... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Change-Id: I972f844bd5845f4d7d88a14ff1b358c8c2b2643d Task-number: QTBUG-45291 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Updated license headersAntti Kokko2016-01-201-15/+21
|/ | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I2fe282e6b9d52f9635cd69e3e8de53724cbb8b0a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix #include's in public headersPierre Rossi2015-08-191-2/+2
| | | | | | | | | | | Uniformly use the <Module/class.h> style, like https://wiki.qt.io/Coding_Conventions mandates. Change-Id: Ia2de5fb5ba4e3229c614c204d43349bd7fcbeaab Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Update copyright headersv5.5.0-alpha1Antti Kokko2015-02-171-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: Iebed549451f58a9fbdd86adf5d0340412d7766d7 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-261-18/+10
| | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Furthermore we need to update the sync.profile to not point to the dev branch in order to integrate this patch in the CI. Change-Id: I06b5496b5d865e2da4808532362616429c969658 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Remove the extra semi-colonsThiago Macieira2014-08-181-2/+2
| | | | | | | qwebchannel.h:60:101: error: extra ‘;’ [-Wpedantic] Change-Id: I7623b68ace59431266ca6a48bfa23bc306363e7e Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Add documentation for the QtWebChannel module.Milian Wolff2014-08-011-19/+0
| | | | | | | | | | | Please proof-read it and tell me what needs to be improved. I assume most people will probably not use the QWebChannel directly. Rather, they will only consume its features indirectly through the integration in QtWebKit/QtWebEngine. Thus the documentation here is for QWebChannel as a library. User-end documentation should be added to QtWebKit, I think. Change-Id: I259c204e24331271b8dc74ea11695988234a79d3 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Refactor and streamline API and IPC protocol.Milian Wolff2014-07-291-2/+0
| | | | | | | | | | | | | | | This patch removes the obsolete API support to send raw messages using a QWebChannel. Instead, it is encouraged to directly use WebSockets or navigator.qt. By doing so, we can cleanup the code considerably. While at it, the transport API is adapted to work on QJsonObject messages, instead of QStrings. This will allow us to use more efficient formats in e.g. QtWebKit or QtWebEngine. One could also implement a JSONRPC interface using a custom transport then. Change-Id: Ia8c125a5558507b3cbecf128a46b19fdb013f47b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* Fix compile warning with clang.Milian Wolff2014-07-281-1/+1
| | | | | | | | QWebChannelPrivate was declared as struct, even though it is defined as class later on. Clang emits a warning in such cases. Change-Id: Ia5988d229d41f02493035e2502955e92079f2baf Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Make the QWebChannel QML API publically accessible.Milian Wolff2014-07-151-6/+8
| | | | | | | | | | This is required for proper QtWebKit/QtWebEngine integration, as otherwise these modules would have to redo a lot of the QtWebChannel QML API. Furthermore, without this, we could not use the WebChannel.id attached property everywhere, independent of the web browser technology. Change-Id: I032a9326841d505c2f77959a240bbfc71e94b6e8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make the registered objects of a QWebChannel accessible.Milian Wolff2014-07-051-0/+1
| | | | | | | This is useful for integration into QtWebKit. Change-Id: I80d79c0ed8a627d62ee45090d7bceca22fdf56ce Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Refactor code to use QWebChannelAbstractTransport and QtWebSockets.Milian Wolff2014-07-041-3/+5
| | | | | | | | | | | | | | | | | | | | | | This is a quite big changeset, but necessary to get the roadmap implemented that was discussed at QtCS. With this patchset landed, the QWebChannel does not depend on QtWebKit anymore, not even for the tests. Rather, we will introduce the dependency in the other way (i.e. QtWebKit will optionally use QtWebChannel if available). For the pure Qt/C++ use-case, we ship a utility implementation of a QWebChannelAbstractTransport that uses a QWebSocket for the server-client communication. This way, we can get rid of the custom WebSocket implementation. The tests are refactored to run the qwebchannel.js code directly inside QML. Integration tests for QtWebKit/QtWebEngine as well as examples will be added to these repositories. Change-Id: Icc1c1c5918ec46e31d5070937c14c4ca25a3e2d6 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix public headers for use with QT_NO_KEYWORDSPierre Rossi2014-06-261-2/+2
| | | | | | | | | QtWebEngineCore has to build that way, so we better make sure the two can play nicely together. Change-Id: Ibab5a2d042b3c8ea230922aeca6768ffec2ca452 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Send response data only to target client.Milian Wolff2014-03-211-1/+0
| | | | | | | | | | | | | | Before, the response was sent to all clients in a broad-cast and had to be filtered on the client-side. This required additional client identification data to be added to all requests and responses. Now, we keep track of the transport and transport-internal client and only send the response to that client. This is very benefitial for multi-client setups but also reduces traffic for single-client setups and thus their performance. Change-Id: Ia1ef5e031b0058222083d352a8aa28a7d566a6ca Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix minor coding style issues.Milian Wolff2014-03-211-2/+2
| | | | | | | | Add space between type name and & or *. Change-Id: I64bfe20510cb43ee0a0b6e08bd433fc657e925a0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Mark some constructor as explicitSergio Ahumada2014-03-191-1/+1
| | | | | | Change-Id: I92c5b00d5bbcc08a241ed0382c13b6bf2676ca6f Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Make the underlying transport mechanism of the webchannel pluggable.Milian Wolff2014-02-061-17/+4
| | | | | | | | | | | | | | | | | | | | | This enables us to optionally use navigator.qt instead of a WebSocket, which is nicer setup-wise and is also slightly faster: navigator.qt: 284.0 msecs per iteration (total: 2,840, iterations: 10) WebSocket: 295.8 msecs per iteration (total: 2,959, iterations: 10) The baseline is ca. 203 msecs, which would mean a performance boost of ca. 12.7%. Furthermore, this sets the fundation to eventually add a WebEngine transport mechanism. The WebViewTransport should also be removed and instead the WebView itself should directly implement the WebChannelTransportInterface. Change-Id: I368bb27e38ffa2f17ffeb7f5ae695690f6f5ad21 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix clang warning about struct which was forward-declared as class.Milian Wolff2014-01-311-1/+1
| | | | | Change-Id: I7dc78213bc57cbfd63b021e00823c4aad105aa05 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix compilation when building with namespaced Qt.Milian Wolff2014-01-311-0/+4
| | | | | | | | Wrap everything in the QtWebChannel module with the Qt namespace or use the Qt namespace where appropriate. Change-Id: I1ef2b2f5eb22ec5e04ca76c034ef8ebf4043b899 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fixup license headers of the files written by me.Milian Wolff2014-01-161-3/+3
| | | | | | | | | | | | Some tests referenced Nokia in their license even though that was never the case. The tests where written completely by me after Qt Nokia times. What is missing are the examples which are still mostly original work by Noam back then in Nokia times. The rest was (re-)written by me completely since then anyways. Change-Id: Ib423fb3459bcc1f7464a02de4fd82ddfd614d282 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add declarative object-registration API to QML WebChannel.Milian Wolff2014-01-101-1/+2
| | | | | | | | | | | | The new registeredObjects list property is now preferred over the old imparative registerObject/registerObjects API. Items that are added to the list need an attached WebChannel.id property which holds the identifier under which the object is published to remote clients. Change-Id: I96a8047b9a85e27f3fd48c900180c22ebd20eb35 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix warning about include in public header.Milian Wolff2014-01-091-1/+1
| | | | | | | | | | | QMake reported the following warnings which is fixed by this patch: QtWebChannel: WARNING: .../qwebchannel/src/webchannel/qwebchannel.h includes qwebchannelglobal.h when it should include QtWebChannel/qwebchannelglobal.h Change-Id: Ib6a330e372a9de32d9578aa17ea0d74257a23676 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup public API, remove private slot.Milian Wolff2014-01-081-3/+0
| | | | | Change-Id: I73a83380c571ed5a400b16cb255562bb8079eaac Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Simplify usage of QWebChannel on the server side.Milian Wolff2014-01-081-2/+33
| | | | | | | | | | | This is achieved by hiding the MetaObjectPublisher completely as private API. The QWebChannel is the only publisher API and now handles both the socket as well as the publisher internally. This now allows us to create a proper QML api in the new QmlWebChannel. Change-Id: I3096364af8485353ca9bc19df4a81a8e4552c3d7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Restructure sources and assimilate to Qt module structure.Milian Wolff2013-12-121-0/+91
This module can hopefully be done in time for 5.3. This commit changes the source structure and QMake files to adapt to typical Qt modules. With this in place, we can now use QT += webchannel in qmake files to link against the pure Qt/C++ QtWebChannel library. The QML plugin is separated from it and can be loaded optionally, if the quick module could be found. Also added is now a qmlplugindump for tooling integration. Note that the Qt.labs namespace is removed. The test file structure is also adapted to how its done in the QtDeclarative module. Note that this setup apparently does not support to run tests without running make install first. Change-Id: I1c15d72e7ab5f525d5a6f651f4e965ef86bc17bd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>