summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Clean up Qt RemoteObjects documentationSona Kurazyan2021-08-175-11/+16
| | | | | | | | | | | | | - Rename Remoteobjects -> RemoteObjects - Fix the import version for QML types - Add a "Using the Module" section, as it is done for most of the modules. - Other minor fixes Pick-to: 6.2 Fixes: QTBUG-94899 Change-Id: If522b0c73994f59a84821fb35d13c11a5d80c172 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Enable use of Flags in .rep filesBrett Stottlemyer2021-08-171-1/+75
| | | | | | Pick-to: 6.2 Change-Id: I511c9592a4f45b6802a75db0db564d8709f0363c Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Add ability to use class enums in .repBrett Stottlemyer2021-08-173-5/+15
| | | | | | | | | | | | This extends the pattern match for enums (NB: w/ backwards compatibility) to allow generation of class enums as well as typed enums. NB2: I didn't realize "regular" enums could be typed in C++11, but that is supported as well. Pick-to: 6.2 Fixes: QTBUG-74835 Change-Id: I8baf334041ca54eefaf9e81f5dd08d7b57819838 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Doc: Add thumbnail images to the example docsVenugopal Shivashankar2021-08-171-0/+6
| | | | | | | | Task-number: QTBUG-95860 Pick-to: 6.2 Change-Id: I14d166d1125251ea949ddcc463aae44299609922 Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* reverseProxy: Update documentationMårten Nordheim2021-08-161-6/+5
| | | | | | | | | | myInternalHost was not connected to any registry so it could not have acquired any reverse-proxied objects. nodeOnRemoteDevice must connect with setRegistryUrl rather than connectToNode to set up notification in both directions. Change-Id: I95f01805731fb1f1b7a14d8bd739666b1f6cb424 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Allow multiline comments in .rep filesBrett Stottlemyer2021-08-101-1/+2
| | | | | | | | | So both single line `//` comments and `/*' ... `*/` comments can be parsed. This allows standard license headers to be included in the files. Pick-to: 6.2 Change-Id: I7bfe573bd786766a7c01e6a9ca0bd2bf0030e123 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Fix crash when using QList<*> with a proxyMichael Brasser2021-08-086-2/+353
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt6 fixes the original test case, as it now generates metatype info at compile time for container classes of all primitive types. `subclass.rep` was modified to include the type QList<MyPOD> as a property, which did crash in Qt6, because PODs can have their metaObjects created at runtime, which do not generate container<POD> metatypes. There are two use-cases which should be supported by a fix. 1) Proxy, where the parameter is stored, but then forward to downstream replicas which can be compiled. In this case, transforming to something that works dynamically should support conversion back to the declared type. 2) Dynamic replicas being used from QML. In this case, the dynamic type should be made available to QML in a way that is equivalent to the declared type. Dynamic storage and QML support are from the type QtROSequentialContainer. This class is derived from QVariant list, but stores a few extra members allow forwarding without losing type information. Over-the-wire transfer is via a new class (QSQ_), which stores the elements in a QByteArray based on the valueType, not the container. Since the type will always be fully known at the source, we can use metatype detection to separate out the problematic types (a sequential container of Q_GADGET types), and convert those to QSQ_ containers for sending. Note: there is one additional piece needed. When we send the definition of a dynamic type (needed for the creation of the dynamic metaobject), we need to change the type of any member or parameter that is a such a container to QtROSequentialContainer. Pick-to: 6.2 Change-Id: Ie2ca53bcbeb4ca0e38c672b5ce951742f625711a Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Restructure CMake API docs to add them to the main CMake docs pageSona Kurazyan2021-08-062-60/+151
| | | | | | | | | | | | | | | | | The main CMake command reference page for all modules uses annotated lists of items that are grouped together (for example, see the link in the bugreport). It has an entry for QtRemoteObjects, but there's no group with the name it links to, so the docs don't show up. Moved the docs for each QtRemoteObjects CMake functions to separate pages, which are grouped as the main CMake doc page expects. This makes CMake API docs for QtRemoteObjects consitent with the docs for other modules. Pick-to: 6.2 Task-number: QTBUG-95433 Change-Id: Ia6ebe1a825ec9bcdfb4628b92a32ad31d3938e24 Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Make sure dynamic replica values are decodedBrett Stottlemyer2021-08-051-0/+7
| | | | | | | | This affects enums and container types (added in a separate patchset). Pick-to: 6.2 Change-Id: I924cd698bfed9a6e6e480132e7f69f38e13665a8 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Refactor decodeVariant to pass by rvalue ref/std::moveBrett Stottlemyer2021-08-049-37/+39
| | | | | | | | | | | | | | The decodeVariant calls were weird in how their parameters were pass by reference so they could be changed, but without forcing a copy. It is clearer to pass by rvalue ref, using std::move on the calling side. This rippled up to calls that called the method, including setProperties which is part of the repc generated code. Because of the repc change, this should *not* be picked to Qt5. Pick-to: 6.2 Change-Id: Ieb1b0620569ad8eb9797edc57cc189d0b426510c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Doc: Use correct documentation groupPaul Wicking2021-08-041-2/+2
| | | | | | | Task-number: QTBUG-94904 Pick-to: 6.2 Change-Id: I372399728e9dbfc95a638e58f149858e293960a3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Rename qt6_rep_from_headers -> qt6_reps_from_headersSona Kurazyan2021-08-033-7/+7
| | | | | | | | | This function generates multiple .rep files in case if multiple headers are passed, so `qt6_reps_from_headers` is a better name. Pick-to: 6.2 Change-Id: I71967f40ec38c817d4414d2470728168a7da06b5 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* CMake: make qt_rep_from_header function pluralSona Kurazyan2021-08-023-7/+7
| | | | | | | | | It can take multiple header files. Pick-to: 6.2 Change-Id: I0105000d63cf06448b2373517d37bfb65fcbf8fb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Clean-up the qremoteobjectsource.h headerSona Kurazyan2021-07-302-98/+114
| | | | | | | | | | | | Move the methods and structs that don't need to be public into the corresponding .cpp file. Pick-to: 6.2 Task-number: QTBUG-94407 Change-Id: I125f17a214e09ff2ea9ae98801b418e07d732868 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix crash when remoting QML objects with sub-objectsMichael Brasser2021-07-221-9/+24
| | | | | | | | | | | | | There are two edge cases to watch out for. First, the property metaType's metaObject() returns a nullptr, so the property QObject pointer's metaObject needs to be used instead. If the QObject is null, the property is skipped, as there is no way to get the metaobject without introducing a dependency on QtQuick. Pick-to: 6.2 5.15 Change-Id: I60ae36dffb30c840858e4d67b9980299c58354b4 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove dead code in serializeDefinition()Brett Stottlemyer2021-07-191-7/+4
| | | | | | | | | | The serializeDefinition() method will only ever be used with dynamic replicas, so there is no need to check isDynamic. Pick-to: 6.2 5.15 Change-Id: Id6d98cc478791a75a04064bfdd297245f1b79c6e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Remove dead code in qt_metacall()Brett Stottlemyer2021-07-191-8/+0
| | | | | | | | | | | | This code within qt_metacall for dynamic replicas was copied from a change for D-Bus in qtbase and doesn't apply here. With readStatus fixed to true, the conditional never runs. See QTBUG-15052 if you are cursious about the related Qt/D-Bus change. Pick-to: 6.2 5.15 Change-Id: I7182ee39e70b9982d4fd953e6e0876d166d4ffb7 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* CMake: Add version-less wrapper for qt6_rep_from_header functionSona Kurazyan2021-07-151-3/+14
| | | | | | | | | And improve the error messages for other wrappers. Fixes: QTBUG-87672 Pick-to: 6.2 Change-Id: I1174850e41d695176074bb7579c32e9a422b98e6 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Document the qt6_rep_from_header CMake functionSona Kurazyan2021-07-152-0/+19
| | | | | | Pick-to: 6.2 Change-Id: I8de0df11e7409cd76d9919cd0bc676703d27564a Reviewed-by: Michael Brasser <michael.brasser@live.com>
* CMake: Add version-less wrapper functionsJoerg Bornemann2021-07-151-0/+24
| | | | | | | | | Add qt_add_repc_sources, qt_add_repc_replicas and qt_add_repc_merged. Fixes: QTBUG-87672 Change-Id: I63deea0c4345958a584163677e18dc835f5cbb30 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* CMake: Rename qt6_add_repc_files to be internalSona Kurazyan2021-07-141-6/+6
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95175 Change-Id: Ia58251275ff4ea9773a60f897e37d09a68dbf6f1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix "Failed to create a timer" issue on WindowsBrett Stottlemyer2021-07-141-2/+11
| | | | | | | | | | | Use a QTimer on the stack instead of the shared QTimer::singleShot(). Thanks to Nahomi Gröhn for the detailed bug report and investigation. Pick-to: 6.2 5.15 Fixes: QTBUG-94570 Change-Id: I212119ed6987266819762c83749b0747acadf026 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Install parser.g from RepParserBrett Stottlemyer2021-07-121-25/+3
| | | | | | | | | It was installed from Qt5/qmake, but was dropped in the conversion to cmake in Qt6. Pick-to: 6.2 Change-Id: Ie15c84cf1fe1d2db09b49eabb7cc120a738ec7a7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make sure dynamic types set enumCount properlyBrett Stottlemyer2021-06-291-1/+2
| | | | | | | | | Future commits will check QDataStream status, and this led to ReadPastEnd (which in this case didn't cause a issue because it would default to zero anyway). Change-Id: Ibef6959c8fdbbe09c302ad286f13ecabd7428062 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Switch usage of QList<QVariant> to QVariantListBrett Stottlemyer2021-06-292-2/+2
| | | | | | | This is a holdover of QVector -> QList conversion Change-Id: I8f7677617ad96d3b45e78e44cbbe7fa97a430c79 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Don't try to access replica's connection when it's not initialized yetSona Kurazyan2021-06-281-10/+26
| | | | | | | | | | | | | | | | | | | | After the recent changes for supporting different serialization backends, we need to get the proper codec from the connection for serializing data. However, it's possible that we will be trying to serialize data, when the connection is not established, e.g. client started without a host, and is trying to send heartbeat packets to check for connection (like in the attached bugreport), or the host is destroyed while the client is still trying to send data). Check if the connection with the source is not null, before using it. Note, that these checks were done also before, but after serializing the data. Now we do them before. Pick-to: 6.2 Fixes: QTBUG-94513 Change-Id: Ie2ca558fc11044513b7886aed736383b16b7464b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Update the outdated '### Qt 6' commentSona Kurazyan2021-06-242-4/+8
| | | | | | | | | | | | | There are plans to enable the reserve proxy functionality for QRemoteObjectHost, so remove the comment suggesting to move it out from its base. Additionally update docs and fix some related pre-existing issues. Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I60da0580648c2b5536e88193d034ed4cfb8d6f7c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Move items from qremoteobjectabstractitemmodeltypes_p.h to QtPrivateSona Kurazyan2021-06-245-156/+160
| | | | | | | | | | | | Move the classes and methods to QtPrivate namespace, to avoid clashes with user code when static linking. Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I9194a13fa923429aa1a294d41befc1a05ff12d78 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Make qremoteobjectabstractitemmodeltypes.h privateSona Kurazyan2021-06-244-6/+17
| | | | | | | | | | | | This header is included only from private headers, doesn't have any exported symbols and can be private. Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I8be45b1b3fe0936d628859ce04c5d79ac5d769ba Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Encapsulate raw string with QLatin1StringKai Köhne2021-06-211-5/+5
| | | | | | | | | Fixes C4996: 'QString::QString': Use fromUtf8, QStringLiteral, or QLatin1String Pick-to: 5.15 6.2 Change-Id: I1642bcae6ad88ceb0487e227e635fa35f6a0520f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remove old configure-related filesJoerg Bornemann2021-06-171-24/+0
| | | | | | | | | | | | | Remove the configure.json and configure.pri files that were used for the qmake-based configure. Remove the .prev_*.cmake files that were a by-product of configurejson2cmake.py. Pick-to: 6.2 Task-number: QTBUG-89536 Change-Id: Ib0c67ef861216f4d64a00c80ed0a9366eab8f262 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Document the renamed classes in the porting guideSona Kurazyan2021-06-171-0/+15
| | | | | | | | Pick-to: 6.2 Change-Id: I0ed937d1ff73b917bf46bd1385e4bcacd9068d7a Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Document the SC and BC guarantees for APIs from qconnectionfactories.hSona Kurazyan2021-06-173-5/+77
| | | | | | | | | | | Updated the warning in qconnectionfactories.h to mention source and binary compatibility guarantees for the classes exported by that header. Added a short overview documentation for these classes. Pick-to: 6.2 Change-Id: Iabeb865908ca05ced1bfb191971806e291915e7e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Rename the classes for adding a custom transport supportSona Kurazyan2021-06-1719-167/+167
| | | | | | | | | | | | | Added QtRO prefix to IoDeviceBase, ServerIoDevice and ClientIoDevice classes. These classes are exported and can be used externally for supporting a custom transport by deriving from them and implementing the virtual methods. Added the prefix also to ExternalIoDevice, to keep the naming consistent. Pick-to: 6.2 Change-Id: I64845cff55687a127d2c43de03ecc65ac9bd321b Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Update to latest qml CMake APIAlexandru Croitor2021-06-056-92/+20
| | | | | | Task-number: QTBUG-91621 Change-Id: I35ef90f6df40fac3808fb19054c66d73b18137c8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove the IoDeviceBase::stream() methodSona Kurazyan2021-06-045-17/+14
| | | | | | | | | | | When support for multiple serialization backends is added, IoDeviceBase shouldn't be aware of the serialization method used (serialization is handled by the codec), so it should have no QDataStream-specific methods. Moved the method returning QDataStream to the private part, so that it can be easily removed later, without breaking SC. Change-Id: I511306ac520c5b745576f5db31dc22f0eadacc62 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Port QRemoteObjectRegistry to new property systemSona Kurazyan2021-06-043-2/+26
| | | | | | | | Task-number: QTBUG-90687 Change-Id: I6c75b7e4cac09f110c377ebc7ed1d72774ffb765 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Make qt6_add_repc_{replica, source} pluralSona Kurazyan2021-05-314-11/+11
| | | | | | | | | Since these functions can take multiple *.rep files, it makes sense to make them plural. Change-Id: I99894e9ee1f6f0035eb8c3e5cdd1292316324577 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Fix static analyzer warningsSona Kurazyan2021-05-313-3/+7
| | | | | | | | | | Removed or added default constructors/destructors/operators definitions where needed, to silence clang static analyzer warnings. Also moved the definition of IoDeviceBasePrivate to a correct location. Change-Id: If0886b8c2315648a6f430776b5d1e78dc70eba0b Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove the old qt5_generate_repc macroSona Kurazyan2021-05-281-112/+0
| | | | | | | In Qt 6 we now have new qt6_add_repc_* commands for running repc. Change-Id: I5739ed9f3525ade48f005da704667d8f343a0288 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Update porting guide with CMake instructions for repc-generationSona Kurazyan2021-05-281-0/+32
| | | | | | | Task-number: QTBUG-93855 Change-Id: I7337288310fac94ef4ec289fa105bbed37a44720 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Document the CMake commands for running repc compilerSona Kurazyan2021-05-286-74/+109
| | | | | | | | | | | Also added the missing instructions for adding the QtRemoteObjects module to a CMake-based project and removed the docs for qt5_generate_repc macro. Task-number: QTBUG-93855 Change-Id: I5116dacba76674217421657dfc404442e3f12701 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Move client-side Codec to IoDeviceBaseBrett Stottlemyer2021-05-278-62/+60
| | | | | | | | | | This is more appropriate than having a separate mapping of connection to Codec. Change-Id: I3b54bfb479de04706a3f9563e7a987af91d0282d Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Move classes for adding a custom transport protocol to a public headerBrett Stottlemyer2021-05-274-210/+274
| | | | | | | | | | | Although these classes weren't documented, they could be used externally to specify a custom transport via inheriting from them and registering the custom classes using qRegisterRemoteObjectsClient() and qRegisterRemoteObjectsServer() methods. Change-Id: Id4cfddf77cd5b55278b5780f4fca447f0706d464 Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Refactor Factory code to hide implementationBrett Stottlemyer2021-05-272-43/+111
| | | | | | | | | | Change to pimpl pattern to allow extension/changes in the future. Change-Id: I289661155aca574430cdbf2d09ea36be7117057b Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Refactor serialization code into an abstracted classBrett Stottlemyer2021-05-2711-151/+254
| | | | | | | | | | | This hides implementation details and allows for different implementations in the future. Change-Id: I5502bb040afe502f7b127668cf7ff81ee79f5e89 Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Update the replica when the layoutChanged signal is emittedAndy Shaw2021-05-054-7/+57
| | | | | | | | | | | When a sort() is done on a QSortFilterProxyModel then it will emit the layoutChanged() signal, so it should ensure that the replica is updated in that case accordingly. Pick-to: 5.15 Fixes: QTBUG-85795 Change-Id: I7f34b24f4fab78c18655e986f54a0eb61db3a7b7 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Remove QMake project filesSona Kurazyan2021-04-1615-303/+4
| | | | | | | | | | | | | | Removed *.pro/*.pri files for sources and tests, we still want to keep them for examples. This patch also removes: - .prev_CMakeLists.txt files - "#special case" and "# Generated from" markers Task-number: QTBUG-88742 Change-Id: I004c8de6048174a1e6db938cf70d1c05369f28d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Add a configurable Qt feature for enabling ham library on QNXSona Kurazyan2021-04-163-5/+51
| | | | | | Change-Id: Ief4ed6121bd44e480d5c7760286d3a498aa61163 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Update QML plugin for QtRemoteObjectsSona Kurazyan2021-04-166-232/+200
| | | | | | | | | | Port the plugin to the new QML type registration system. Due to QML element registration via QML_ELEMENT* and friends, plugins.qmltypes is not needed anymore (it's generated). Also no need in setting the module import versions manually, so update the docs accordingly. Change-Id: Idf67ac9a53d00564501e1d8b9f2f296c27bed58a Reviewed-by: Brett Stottlemyer <bstottle@ford.com>