| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
The new API isn't limited to 10 parameters. It also does its own
parameter matching, which we use here to locate the method to be
called. I don't think that was necessary, though, because we sort the
methods to be called in order of preference.
Fixes: QTBUG-105596
Change-Id: I36b24183fbd041179f2ffffd170268620633a72b
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
There's been recent header refactorings, this fixes the fallout.
Pick-to: 6.3 6.2
Change-Id: I632f652ed12e151af6d1ad09c3ace510f60747ab
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
|
|
|
|
|
|
|
|
| |
Don't rely on the transitive include of qproperty.h by qobject.h.
Pick-to: 6.2
Change-Id: I180394ed09dae1bd3106171c17dbe035f6328806
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
[ChangeLog] Make blockUpdates bindable
Task-number: QTBUG-93601
Change-Id: I7a5e06ecb3258b11988343321b78ffaab1d48dc0
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
|
|
|
|
|
|
|
|
| |
[ChangeLog][QMetaObjectPublisher] Handle per-transport client idle status
Task-number: QTBUG-92927
Change-Id: I5a06261e6dddb0fc0fae9f73b280c61cf5a2b52d
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
|
|
|
|
|
|
|
|
| |
[ChangeLog] Make the property update interval configurable
Fixes: QTBUG-92928
Change-Id: I0b02ae0c0879c1a3891d5807c1ff8c1f619841b2
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
|
|
|
|
|
|
|
|
|
|
|
| |
If the property is BINDABLE but lacks a NOTIFY signal, the
client will have no way to register a callback for change
notifications. Document this behavior as such.
A future patch could synthesize signals for purely BINDABLE
properties on the client side, but this needs some more thought.
Change-Id: I5e723e294dc01890956fee179fb3ba30aecf8cc1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not call `sender()` from a different thread. As the API documentation
indicates, that is not supported and can lead to crashes as experienced
on the CI frequently.
Instead, we now have per-thread SignalHandlers and use those to get
notified about signals and metacall events.
Moving a registered object into a different thread isn't supported once
it was registered. But the object can be deregistered, moved, and then
re-registered.
[ChangeLog] Signals from objects living in a different thread than the
QWebChannel are now handled correctly.
Task-number: QTBUG-51366
Change-Id: I1edb0694b946a494b6c0d4a8a6dc6b452dcb2c7a
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous unit test for self-contained objects only wrapped the test
object once. After wrapping, a different code path is taken which still
exhibited infinite recursion. This patch addresses both the unit test
and the infinite recursion.
To fix the problem, a boolean in the ObjectInfo struct is toggled to
indicate whether the object in question is currently being wrapped. If
that is the case, the recursing code path is skipped.
[ChangeLog][General] Fixed infinite recursion when dealing with self
contained objects.
Fixes: QTBUG-84007
Pick-to: 5.15
Change-Id: Ie0898fb5f28cec91587897835ff937672d60f2a1
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-84469
Change-Id: Ide3fa7a558b456354703dd7fd5ee414647e24934
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This converts QObjects that are embedded inside ECMAScript objects
into the actual QObject that they represent.
For example, if an array of QObjects is passed as an argument to
a method, the method will received a QVariantList where the
items are QVariants of type QObjectStar.
Method:
void processObjects(const QVariantList &list);
Call from ECMAScript:
theObj.processObjects([qobj1, qobj2])
Prior to this patch, the method would have received a list
containing QVariantMaps with keys from the QObject EMCAScript wrapper
(e.g. __objectSignals__, __propertyCache__, etc.).
After this patch, it will receive a list containing QVariants with
QObject* inside.
QVariantMaps are converted to QObjects if they have a property
called "__QObject*__" set to true and an "id" property.
"__QObject*__" is the same identifier for retuned objects and is
now added in a toJSON method at the client.
Change-Id: I5cafcddb9df0141977a574aaed4ce7c3ea2d0767
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements host-side overload resolution. If a client invokes a method
by its name instead of its id, the overload resolution tries to find the best
match for the given arguments.
The JavaScript client implementation now defaults to invocation-by-name, except
when a method is invoked by its full signature. In that case, the invocation
is still performed by method id.
Change-Id: I09f12bdbfee2e84ff66a1454608468113f96e3ed
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a new transport is accessing a previously wrapped object, we used
to send potentially outdated property values.
[ChangeLog][QWebChannel][General] Send current property values when
another transport is accessing a previously wrapped object.
Fixes: QTBUG-62388
Change-Id: I5cd5772b42c3cb9860e945bb85f77f0e3b6d6ea0
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QObjects that are present in an array are already converted to
an object identifier. This does the same for variant maps, which
end up as ECMAScript objects.
This allows QObjects put into a QVariantMap to be properly
deserialized. For example, if a property is declared as such:
Q_PROPERTY(QVariantMap propName READ propName CONSTANT)
And propName is:
QVariantMap propName() const {
QVariantMap map;
map.insert("theProperty", QVariant::fromValue(someQObject));
return map;
}
The "theProperty" property will now properly refer to the object.
Change-Id: I3c6e71b860f6825a31eb337aeffa55302287c8ff
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
| |
Change-Id: I8661063408d17c80a04433beda595061e89b5ba8
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Similar to the previous issue, where these types were not properly
converted to QVariant when invoking a method, we manually do the
conversion now to get the desired behavior. The culprit is again
that QJsonValue::toVariant converts an object e.g. to a QVariantMap,
and not to a QVariant containing a QJsonObject.
[ChangeLog] QObject properties of type QJsonValue, QJsonArray or
QJsonObject can now be set via the Qt WebChannel.
Task-number: QTBUG-48198
Change-Id: I5d574b1a5cffd6d6ad9b555f2a3e872b9c3425a7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Added a QMultiHash which maps transport objects to wrapped object ids.
transportRemoved iterates over all matching wrapped objects and removes
the passed transport object from their transports-vector. If the
transports-vector is empty after removing the passed transport object
the objectDestroyed will be called on the wrapped object.
transportRemoved will be called either on the transports destoryed
signal or on disconnecting the webchannel from it.
Without this changes the QMetaObjectPublisher::wrappedObjects and
::registeredObjectIds would only be cleaned up if the website calls
deleteLater on QObjects but not on website reloads.
Task-number: QTBUG-50074
Change-Id: If294564fee2406edd7fb578852aeb269cac23a92
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|/ /
| |
| |
| |
| | |
Change-Id: I8da406c190ed3e3f925c50ede6c7b845033837b9
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
Change-Id: I42bfb38e5a9bf03b43636309fe9e29e8d772bb06
|
| |
| |
| |
| |
| | |
Change-Id: I34bcf2e4a2d66c9cb126c2edae79a45064b82a67
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|/
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Signals and property changes caused by dynamically created
qobjects (qobjects returned from a method call at runtime)
should not be broadcasted to any client but only sent to clients
which know these qobjects.
Also added testcases for the changes.
Change-Id: I9aacfa9e7e9df9314b44c6ba8e7339a2069e3c37
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, a new client gets a list of _all_ registered QObjects,
whether they were explicitly registered or not.
This leaks internal information which the clients cannot use right away
anyway.
Change-Id: I4b25a731e9bc2d646f903057b409aecd34dc7f11
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
| |
Change-Id: Ic51555b34823354092a5a4e8583c51d50a1aded8
Reviewed-by: Milian Wolff <milian.wolff@kdab.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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Change-Id: I92c5b00d5bbcc08a241ed0382c13b6bf2676ca6f
Reviewed-by: Milian Wolff <milian.wolff@kdab.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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces the traffic as the indices are usually much smaller than
the property names.
As such, the benchPropertyUpdates gets a speed boost of about 9% (or
10ms vs. 11ms). As we need to transmit the index during initialization
that degrades its performance slightly by ca. 4% (13ms vs. 12.5ms).
Considering that the initialization only takes place once whereas
the property updates potentially often, this is a good tradeoff.
Change-Id: If7df3e360f1528b7d7aa26c63ce851363ae9fd6a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Before, we constructed QVariant maps and lists and then converted them
to JSON to send the data to the webchannel.
By obsoleting the conversion step, benchInitializeClients shows a good
performance boost of ca. 19% (11.81ms vs 14.58ms).
Change-Id: Ief8e8127207a046f481488a478cd6a18fa0ebffe
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
|
|
This allows us to remove the public API for the tests and allows for
more tests and benchmarks in the future.
To achieve this, we re-use the new qmetaobjectpublisher_p.h, which then
also must be exported.
Change-Id: I3c33b2f5be6cc674cd3092667151dd8da2263cf5
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
|