summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Improve backward supportAllan Sandfeld Jensen2023-02-141-7/+7
| | | | | | | Do both variant conversions and qjsonvalue conversions. Change-Id: I655395aa64c83ef62e8062d0820fdff437ebb156 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add server-side support for custom convertersArno Rehn2023-02-092-18/+24
| | | | | | | | | Automatically tries to convert server-side values to/from QJsonValue. Carries on as usual when the conversion fails. Fixes: QTBUG-92902 Change-Id: I89ae7c3bc8490223c9fab41ca513d9277483692e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix project structure and auto registryMichal Klocek2023-02-0317-247/+97
| | | | | | | | | | | | | | | | | | | Create QtWebChannelQuick and move the required sources, so auto registry works and qml types files and friends are auto generated. This makes things inline what other modules do. This change has a side effect as qqmlwebchannel.h will change its module, however this is semi-pulibc header, hopefully only used by QtWebEngine. [ChangeLog] Created new QtWebChannelQuick which holds qml sources. Task-number: QTBUG-110795 Fixes: QTBUG-99959 Change-Id: Ic8aa72f070d6a9e23d918a1210f4df62df739397 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* SignalHandler: optimize remove(QObject*)Marc Mutz2022-12-251-5/+5
| | | | | | | | | | | | | | | | | | | Don't look up the object in m_connectionCounter three times (contains(), value(), remove()). Instead, use find() to find it once, and std::move(it.value()) + erase() as a take() that can report whether the element existed in the container prior to extraction. This also means we can port the foreach loop to a ranged for loop now without hesitation: by erasing the element from the container before iterating over the QObject::disconnect() calls, we ensure immunity against a potential reentrance into the object (disconnectNotify() calls unknown code) that changes m_connectionsCounter, which the foreach loop was immune against (d/t taking a copy of the container under iteration). Change-Id: I6cf36c729f488bf1334fd344ddd0191db101d103 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Add wrappers to optionally convert incoming dataØystein Heskestad2022-11-111-1/+10
| | | | | | | | | | | | | | | | | Wrappers can be added as a third argument to WebChannel constructors or by explicitly calling addConverter. They can be added by supplying their name or by supplying a function. If the function is not applicable it must return undefined to proceed to to the next wrapper. Data is transmitted as JSON when sent over the WebChannel. Because JSON does not have a date, type QDateTime objects are sent as ISO 8601 text strings. The "Date" converter converts such strings to ECMAScript Date objects. Fixes: QTBUG-98490 Change-Id: I83bb7476b50838359db5b981f500871142fa41f0 Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: Ife5eb4ded5b31ee3cca69ab6b6e6a94a08de32ab Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-072-4/+4
| | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: I34d5ddf6742eda92ae291d2fd0ced98fcee92b7b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QMetaObjectBuilder: pass meta types to QMetaMethodInvokerThiago Macieira2022-09-161-1/+4
| | | | | | Task-number: QTBUG-105596 Change-Id: Ic6547f8247454b47baa8fffd170bbd389cfb38c6 Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Remove warnings about no transport being connectedArno Rehn2022-09-021-3/+0
| | | | | | | | | | No transport being connected is a usual situation for a QtWebChannel server. It just so happens when no client is connected. Printing warnings about no transports being connected just creates spam in the logs without any gain. Change-Id: Ia74918112a7012437a5b6f1ed97f1c4bbd557816 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QMetaObjectPublisher: use new way to QMetaObject::invokeMethodThiago Macieira2022-08-254-83/+70
| | | | | | | | | | | 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>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-234-4/+4
| | | | | | | Task-number: QTBUG-105718 Change-Id: I99e928ef0cb271ef28692d0936230ecf0fd08392 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add the missing header files to a CMake source treeAlexey Edelev2022-08-011-6/+3
| | | | | | Task-number: QTBUG-103196 Change-Id: I58584120831b1d5b5ec06b1500bf39a90ca9963b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* VariantArgument: use QGenericArgument directly instead of Q_ARGThiago Macieira2022-07-181-1/+1
| | | | | Change-Id: I36b24183fbd041179f2ffffd1702682d7d5d17fe Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
* Add license headers to cmake filesLucie Gérard2022-07-074-0/+12
| | | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I28932fdec21ec9cd2ad33d0ecd7baa7c1e5dcd36 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-1021-729/+45
| | | | | | | | | | | 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>
* Fix missing includesVille Voutilainen2022-05-171-0/+1
| | | | | | | | 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>
* Enable documentation testing in CITopi Reinio2022-05-091-4/+7
| | | | | | | | | | | And fix issues with the documentation config; Replace obsolete selectors with up-to-date ones and add a dependency to qtcmake to make linking to CMake manual work. Pick-to: 6.3 Change-Id: I964fd21b252af4b9ae034de9be84fafc32b80646 Reviewed-by: Luca Di Sera <luca.disera@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Revise Qt Web Channel module landing pageAndreas Eliasson2022-03-281-35/+34
| | | | | | | | | | Remove the include directive section and add global CMake and qmake snippets. Also, reorganize some of the sections structure. Task-number: QTBUG-100369 Pick-to: 6.3 6.3.0 Change-Id: I6af1a2e4a9e77a1ae7a2a3a5d515929683ea26da Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Remove .prev_CMakeLists.txtKai Köhne2022-03-221-24/+0
| | | | | | Pick-to: 6.3 Change-Id: I78d6a6b2d245743f1cce18955ed3fc05a054f9fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Make sure all private headers include at least one otherThiago Macieira2022-03-083-1/+4
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Do not highlight the WebChannel Standalone Example anymore in Qt CreatorZhang Hao2022-02-161-2/+0
| | | | | | | | Pick-to: 6.3 Fixes: QTBUG-100650 Change-Id: I65b565bedee9107b0d348446c9fc3c00509db058 Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io> Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Remove unused .qrc fileJoerg Bornemann2022-01-181-5/+0
| | | | | | | Task-number: QTBUG-94446 Change-Id: I0d1410bb1664be33c431229975d9ca9673077acb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* QMetaObjectPublisher: Never send stale queued messagesArno Rehn2021-12-141-3/+15
| | | | | | | | | | | | | | | | | | | If the client is connected with an in-process transport, it can happen that a transmitted message triggers a subsequent property change. In that case, we need to ensure that the queued messages have already been cleared; otherwise the recursive call will send everythig again. Case in point: The qmlwebchannel tests fail if we don't clear the queued messages before sending them out. For that same reason set the client to "busy" (aka non-idle) just right before sending out the messages; otherwise a potential "Idle" type message will not correctly restore the Idle state. Pick-to: 6.2 Pick-to: 6.3 Change-Id: Idc4afdd5cf4b4e03b8de8953a03d28442d74a3ab Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Include <QProperty> explicitlyMarc Mutz2021-11-081-0/+1
| | | | | | | | 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>
* Transparently handle QFuture<T> method return typesArno Rehn2021-09-272-3/+103
| | | | | | | | | | | | | When a client invokes a method returning a QFuture<T>, QWebChannel will now automatically attach a continuation and send the contained result after the QFuture<T> has finished. [ChangeLog] Transparently handle QFuture<T> method return types Task-number: QTBUG-92903 Change-Id: I4069d51e79447dee249bb8af52a16e4496484093 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Migrate to autogenerated cpp exportsAlexey Edelev2021-09-272-14/+2
| | | | | | | | | Replace the hardcoded cpp exports with a generated one where it's applicable. Task-number: QTBUG-90492 Change-Id: I2017cb07a3f4689aa0120da7b32241352a47ae27 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Doc: Remove unsupported customFiltersKai Köhne2021-08-251-4/+0
| | | | | | Task-number: QTBUG-95987 Change-Id: Idd7c097ca481507a60e3058c3c3cd73ed84e2bb5 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2021-08-091-1/+1
| | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces the last usage of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in qtwebchannel. As the two are synonymous, this patch should have no impact on users. Task-number: QTBUG-86829 Change-Id: Ife09cad141088ce988a948ecdc5df385fdffd80a Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Doc: Add Changes Qt 5 to Qt 6 page to Qt WebChannelPaul Wicking2021-08-041-0/+44
| | | | | | | | | Add a basic changes page for consistency with other modules. Task-number: QTBUG-94931 Pick-to: 6.2 Change-Id: I3076247496ec6171144afde877d7f958497a685e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Remove outdated qmake pro-filesØystein Heskestad2021-07-194-72/+0
| | | | | | Task-number: QTBUG-95167 Change-Id: I199e41cd2bd582b3f4d47b6d516fa2f506f93855 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* CMake: Don't give plugins PUBLIC usage requirementsJoerg Bornemann2021-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | The pro2cmake.py conversion script faithfully reproduced the .pro files for the plugins, which specified the libraries as public. But in CMake, the implications of this are that public usage requirements should then be propagated to consumers. We don't expect any consumers, since a plugin is created as a MODULE library in CMake, so for Windows we don't even have an import library to link with. The only exception to this is for static builds where plugins are created as STATIC libraries instead, but only in certain controlled situations do we then link to plugins. Even then, usage requirements are not expected to propagate to the consumers, so these relationships should always be specified as private. Pick-to: 6.2 Task-number: QTBUG-90819 Change-Id: Ia7a8f27d4eecf067055511577ec664ad857905cd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update to new CMake API for QMLUlf Hermann2021-06-051-3/+8
| | | | | Change-Id: Ia31e5a4690f7c6801b13671a74cb0f13969e7393 Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Make blockUpdates bindableØystein Heskestad2021-05-204-12/+32
| | | | | | | | [ChangeLog] Make blockUpdates bindable Task-number: QTBUG-93601 Change-Id: I7a5e06ecb3258b11988343321b78ffaab1d48dc0 Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Handle per-transport client idle statusØystein Heskestad2021-05-202-24/+85
| | | | | | | | [ChangeLog][QMetaObjectPublisher] Handle per-transport client idle status Task-number: QTBUG-92927 Change-Id: I5a06261e6dddb0fc0fae9f73b280c61cf5a2b52d Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Speculative fix for Android and iOS compilation issueAllan Sandfeld Jensen2021-05-141-1/+1
| | | | | Change-Id: I7b3056cb77a2b46c7ebb67221cc3eaee49a9f6e2 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Make property update interval configurable and add testsØystein Heskestad2021-05-054-12/+87
| | | | | | | | [ChangeLog] Make the property update interval configurable Fixes: QTBUG-92928 Change-Id: I0b02ae0c0879c1a3891d5807c1ff8c1f619841b2 Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
* Use QProperty observation to push property updates to clientsArno Rehn2021-04-223-31/+138
| | | | | | | | | | | 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>
* Handle signals in the registered object's threadMilian Wolff2021-04-163-7/+24
| | | | | | | | | | | | | | | | | | | | | 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>
* Replace Q_NULLPTR with nullptr and fix a warningØystein Heskestad2021-03-233-10/+10
| | | | | | | | * 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>
* Re-generate CMake project filesJoerg Bornemann2021-03-151-5/+5
| | | | | | Change-Id: I7973833fa7b4000cb8f6e1a1fc0a8c560fe16a3b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Stop using foreachAllan Sandfeld Jensen2021-02-011-7/+7
| | | | | Change-Id: I46f916ad88ef7cf66d27d0549d9a66cf0e03eddc Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Fix variant conversion after change in qtbaseAllan Sandfeld Jensen2021-02-011-0/+3
| | | | | | | | A change to make QByteArray and QString iterable sequences, changed the result of QVariant::canConvert<QVariantList> to true. Change-Id: If4c335a60fde88cd8e921314f481f41188a3d9f2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge "Merge remote-tracking branch 'origin/wip/cmake' into dev"Allan Sandfeld Jensen2021-01-297-0/+126
|\
| * Merge remote-tracking branch 'origin/wip/cmake' into devAllan Sandfeld Jensen2021-01-297-0/+126
| |\ | | | | | | | | | | | | | | | | | | Regenerating and fixing as needed. Fixes: QTBUG-90661 Change-Id: Ief9f044d4b9ea2ce8130b11031fb93b6e673fbdd
| | * Regenerate projectswip/cmakeAlexandru Croitor2019-11-253-8/+33
| | | | | | | | | | | | | | | | | | | | | Change-Id: Ibdadef34b1b7d4ea98140feed171c409eb8bafde Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Add cmake supportJüri Valdmann2019-09-236-0/+103
| | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-78190 Change-Id: Ibdfbcb479ce1af6370b9148516cef6f64e7c1abb Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Stop using deprecated QVariant::type()Allan Sandfeld Jensen2021-01-291-3/+3
|/ / | | | | | | | | Change-Id: I46c782de038e973eae54f6f187ed606d18708c41 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Use qsizetype instead of int for QQmlListPropertyPeter Varga2020-12-012-17/+12
| | | | | | | | | | | | | | Fixes build with the latest qtdeclarative. Change-Id: Ib075cf3515db044c00b93f71ae651151f7e64a97 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Stop using deprecated QMetaType functionsAllan Sandfeld Jensen2020-09-211-11/+13
| | | | | | | | | | | | | | | | Switch to new functions operating directly on QMetaType object, instead of ints. Change-Id: Ief0ba04f4447a5f891f8187cb0cf4250ce287311 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Use QVariant(QMetaType, const void *) constructorJüri Valdmann2020-09-102-3/+3
| | | | | | | | | | | | | | | | | | The deprecated QVariant(int, const void *) constructor has been removed in qtbase. The QVariant(QMetaType, const void *) constructor should be used instead. Change-Id: I01a22e1334d0e8ae74be7d9c055cb092ac3d1cf6 Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>