| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
This enables you to pass `QObject*` parameters via signals to the
JavaScript side. The object will be serialized and then unwrapped
as needed now.
Task-number: QTBUG-54243
Change-Id: Ie8a6d14eb1351f14f1855d242ceb3b3f8262152d
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you get an object from the server and want to pass it back to the
server via a function the id of the object is passed instead of the
whole json object. On the server side QMetaObjectPublisher::invokeMethod
now looks up the object in QMetaObjectPublisher::wrappedObjects by the
passed object-id.
Task-number: QTBUG-50075
Change-Id: Id0df2dfaa79bcba12ca48391ae7537ac1a086898
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QDialog for instance adds a setter for the modal property already
exposed by QWidget.
Object.defineProperty requires configurable set to true in order to
add that setter at a later stage.
Adds some reusable autotest logic with a soft dependency on QJSEngine to
test some of the C++/JS integration aspects.
Task-number: QTBUG-46548
Change-Id: Ibd49274f7d334c068c4006fb09417abf911c24e9
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When wrapping a registered object the code generated a new
ID for an already known object. That new ID wasn't stored
but returned to the client including the objects information.
That resulted in a new created object on client side but
the remote object (on the server) was not accessible.
This patch fixes the issue by just returning the known ID
of a known object. Because the client already has a local
representation of that object it does not have to unwrap
the object description.
Change-Id: I31964823c84c84fd7ebce4386865c18fb5518be7
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This merge required extensive conflict handling because
the bug fix in 5.4 to properly wrap and forward QObjects
referenced by published objects' properties clashed with
some feature additions in dev, namely the client separation
logic.
All unit test pass for me locally now again.
Conflicts:
.qmake.conf
src/webchannel/qmetaobjectpublisher.cpp
tests/auto/qml/tst_webchannel.qml
Change-Id: If3d00e13b265c6ab9fb2c38023014f97f8e7779b
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Similar to the support for factory-methods, we must wrap objects in
properties to make them accessible to clients. This patch adds the
required code for that. Besides support for simple properties that
reference an object, this patch also adds support for list properties
that contain objects.
The client-side unwrap of properties is delayed until all objects
are initialized, as a property might reference another registered
object.
Change-Id: I9fb90a8eab4c66d2f4231fdb482e0d97d128df3e
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Instead, send the data as a response to the initialization request
message. This simplifies the code and makes it more predictable, as we
do not spam all clients with initialization broadcasts anymore.
Note that the pending initialization "feature" is removed, but I don't
see a need for it anymore. If you want to delay client initialization,
do it on the client side.
Change-Id: I1ab71fd6c9e809ccb6085f1a3fbac3eb9b2e910b
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
|
|
|
|
|
|
|
|
|
|
| |
The web channel always connects to that signal automatically for
internal book-keeping purposes. Thus we do not have to connect to the
signal for wrapped objects. This simplifies the tests and reduces the
IPC traffic for wrapped objects.
Change-Id: Iaf8d9ce0b87874917cdcdf9013e21a53ee36b53a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was a historic artefact which should not be required anymore.
Back then it was added when trying to improve the perceived performance
of the webchannel on an embedded device. Nowadays, using the built-in
WebKit IPC mechanism instead of WebSockets, paired with the rest of
the code cleanup and other changes, it should not be required anymore.
Change-Id: I4b2d76d84aaf92e12592a0b2bcf94710b697846e
Reviewed-by: Lutz Schönemann <lutz.schoenemann@basyskom.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The JS lib will miss to add QObjects to the local
object descriptions when receiving a new description
and the user has not registered a callback function.
This patch makes the lib execute unwrapQObject for
all responses received from a function call.
Change-Id: I72d872d65a7e7bec1d7e6ffb1eea674d0f6e50d7
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This assimilates the JavaScript side to the QML/C++ side. We get rid
of the automagic WebSocket code. Instead, users pass in the WebSocket
from the outside, if they want to use that for communication. In the
QtWebKit/QtWebEngine cases, we will pass in our custom IPC objects.
Change-Id: I15e15b5130f99dc8b39dfbfa8cd3d8b2d34dbbc0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Lutz Schönemann <lutz.schoenemann@basyskom.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
The module.export allows qwebchannel.js being included and used from
within a nodejs environment.
Change-Id: I3db6ba85e8d3406031c0262815e50aca0f214ace
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
|
| |
__define[SG]etter__ are non-standard.
Object.defineProperty is the standard way to do this.
See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__
Change-Id: If58e420fe84ef2fbb005838955fabf9d96f225b0
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
This simplifies the usage and lets properties be used just like normal
JavaScript properties. This is possible since the properties are cached
on the HTML side.
Change-Id: Ic60076f4596cd8df063567dfbd630e5bd6403119
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
This further reduces the network traffic and thus leads to a small
performance boost.
Personally, I also think this code is a bit nicer to read and grasp.
Change-Id: I943c621142e9982f0e52d24e3a0976428856541b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the custom WebSocket server implementation and replaces
it by a dependency on the QtWebSockets module.
Sadly, the QtWebSocket module does not yet support custom protocols.
Also, there is quite some boiler plate code required, something which
I want to simplify upstream in the QtWebSockets module later.
Change-Id: I8066418fb1857d23b8593c443bc9a98ded917a99
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
The code now resides in a single qwebchannel.js file and there is only
a single callback-nesting required to setup a MetaObjectPublisher
connection.
The server-side will be simplified in the next step.
Change-Id: Ib5fc77a03c2b281c61af91713411eed571ec6108
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|