├── .cmake.conf ├── .gitreview ├── .tag ├── CMakeLists.txt ├── LICENSES ├── BSD-3-Clause.txt ├── GFDL-1.3-no-invariants-only.txt ├── GPL-2.0-only.txt ├── GPL-3.0-only.txt ├── LGPL-3.0-only.txt ├── LicenseRef-Qt-Commercial.txt └── Qt-GPL-exception-1.0.txt ├── REUSE.toml ├── coin ├── axivion │ └── ci_config_linux.json └── module_config.yaml ├── dependencies.yaml ├── dist ├── REUSE.toml ├── changes-5.11.0 ├── changes-5.11.1 ├── changes-5.11.2 ├── changes-5.11.3 ├── changes-5.12.0 ├── changes-5.12.1 ├── changes-5.12.2 ├── changes-5.12.3 ├── changes-5.12.4 ├── changes-5.12.5 ├── changes-5.13.0 ├── changes-5.13.1 ├── changes-5.13.2 ├── changes-5.14.0 ├── changes-5.14.1 ├── changes-5.14.2 ├── changes-5.15.0 └── changes-5.15.1 ├── examples ├── CMakeLists.txt ├── examples.pro └── remoteobjects │ ├── CMakeLists.txt │ ├── clientapp │ ├── CMakeLists.txt │ ├── Clock.qml │ ├── Plugins.qml │ ├── center.png │ ├── clientapp.pro │ ├── clock.png │ ├── doc │ │ ├── images │ │ │ └── clientapp-example.webp │ │ └── src │ │ │ └── clientapp.qdoc │ ├── hour.png │ ├── main.cpp │ ├── minute.png │ ├── plugin.h │ ├── plugins0.qml │ ├── plugins1.qml │ ├── plugins2.qml │ └── qmldir │ ├── modelviewclient │ ├── CMakeLists.txt │ ├── doc │ │ └── src │ │ │ └── modelviewclient.qdoc │ ├── main.cpp │ └── modelviewclient.pro │ ├── modelviewserver │ ├── CMakeLists.txt │ ├── doc │ │ └── src │ │ │ └── modelviewserver.qdoc │ ├── main.cpp │ └── modelviewserver.pro │ ├── remoteobjects.pro │ ├── remoteobjects_server │ ├── CMakeLists.txt │ ├── doc │ │ ├── images │ │ │ └── remoteobjects-server-example.webp │ │ └── src │ │ │ └── remoteobjects_server.qdoc │ ├── main.cpp │ ├── remoteobjects_server.pro │ ├── timemodel.cpp │ └── timemodel.h │ ├── simpleswitch │ ├── CMakeLists.txt │ ├── directconnectclient │ │ ├── CMakeLists.txt │ │ ├── client.cpp │ │ ├── client.h │ │ ├── directconnectclient.pro │ │ ├── main.cpp │ │ └── simpleswitch.rep │ ├── directconnectserver │ │ ├── CMakeLists.txt │ │ ├── directconnectserver.pro │ │ ├── main.cpp │ │ ├── simpleswitch.cpp │ │ ├── simpleswitch.h │ │ └── simpleswitch.rep │ ├── doc │ │ └── src │ │ │ └── simpleswitch.qdoc │ └── simpleswitch.pro │ ├── ssl │ ├── CMakeLists.txt │ ├── doc │ │ └── src │ │ │ └── ssl.qdoc │ ├── ssl.pro │ ├── sslcppclient │ │ ├── CMakeLists.txt │ │ ├── main.cpp │ │ └── sslcppclient.pro │ └── sslserver │ │ ├── CMakeLists.txt │ │ ├── cert │ │ ├── cert.qrc │ │ ├── client.crt │ │ ├── client.key │ │ ├── readme │ │ ├── rootCA.key │ │ ├── rootCA.pem │ │ ├── rootCA.srl │ │ ├── server.crt │ │ └── server.key │ │ ├── main.cpp │ │ ├── sslserver.pro │ │ ├── timemodel.cpp │ │ └── timemodel.h │ ├── timemodel.rep │ └── websockets │ ├── CMakeLists.txt │ ├── common │ ├── cert │ │ ├── cert.qrc │ │ ├── client.crt │ │ ├── client.key │ │ ├── readme │ │ ├── rootCA.key │ │ ├── rootCA.pem │ │ ├── rootCA.srl │ │ ├── server.crt │ │ └── server.key │ ├── common.pri │ ├── websocketiodevice.cpp │ └── websocketiodevice.h │ ├── doc │ └── src │ │ └── websocket.qdoc │ ├── websockets.pro │ ├── wsclient │ ├── CMakeLists.txt │ ├── main.cpp │ └── wsclient.pro │ └── wsserver │ ├── CMakeLists.txt │ ├── main.cpp │ └── wsserver.pro ├── licenseRule.json ├── mkspecs ├── features │ ├── features.pro │ ├── remoteobjects_repc.prf │ ├── repcclient.pri │ ├── repccommon.pri │ ├── repcmerged.pri │ ├── repcserver.pri │ └── repparser.prf └── mkspecs.pro ├── src ├── CMakeLists.txt ├── remoteobjects │ ├── CMakeLists.txt │ ├── Qt5RemoteObjectsConfigExtras.cmake.in │ ├── Qt6RemoteObjectsMacros.cmake │ ├── configure.cmake │ ├── doc │ │ ├── images │ │ │ ├── DirectConnectClientServerOutput.png │ │ │ ├── DirectConnectServerOutput.png │ │ │ ├── README │ │ │ ├── RemoteObjectsHighLevel.png │ │ │ ├── StandardItemTableWindow.webp │ │ │ ├── ble_example_flow.png │ │ │ ├── ble_example_iodevice.png │ │ │ ├── simpleswitch-example.webp │ │ │ └── ssl-example.webp │ │ ├── qtremoteobjects.qdocconf │ │ ├── snippets │ │ │ ├── README │ │ │ ├── cmake-macros │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── main.cpp │ │ │ │ ├── simpleswitch.cpp │ │ │ │ ├── simpleswitch.h │ │ │ │ └── simpleswitch.rep │ │ │ ├── doc_src_remoteobjects.h │ │ │ └── doc_src_simpleswitch.cpp │ │ └── src │ │ │ ├── cmake-macros.qdoc │ │ │ ├── qt6-changes.qdoc │ │ │ ├── remoteobjects-compatibility.qdoc │ │ │ ├── remoteobjects-cpp.qdoc │ │ │ ├── remoteobjects-custom-transport.qdoc │ │ │ ├── remoteobjects-example-dynamic-replica.qdoc │ │ │ ├── remoteobjects-example-registry.qdoc │ │ │ ├── remoteobjects-example-static-source.qdoc │ │ │ ├── remoteobjects-examples.qdoc │ │ │ ├── remoteobjects-external-schemas.qdoc │ │ │ ├── remoteobjects-gettingstarted.qdoc │ │ │ ├── remoteobjects-index.qdoc │ │ │ ├── remoteobjects-interaction.qdoc │ │ │ ├── remoteobjects-nodes.qdoc │ │ │ ├── remoteobjects-qml.qdoc │ │ │ ├── remoteobjects-registry.qdoc │ │ │ ├── remoteobjects-repc.qdoc │ │ │ ├── remoteobjects-replica.qdoc │ │ │ ├── remoteobjects-source.qdoc │ │ │ ├── remoteobjects-toc.qdoc │ │ │ └── remoteobjects-troubleshooting.qdoc │ ├── qconnection_local_backend.cpp │ ├── qconnection_local_backend_p.h │ ├── qconnection_qnx_backend.cpp │ ├── qconnection_qnx_backend_p.h │ ├── qconnection_qnx_global_p.h │ ├── qconnection_qnx_qiodevices.cpp │ ├── qconnection_qnx_qiodevices.h │ ├── qconnection_qnx_qiodevices_p.h │ ├── qconnection_qnx_server.cpp │ ├── qconnection_qnx_server.h │ ├── qconnection_qnx_server_p.h │ ├── qconnection_tcpip_backend.cpp │ ├── qconnection_tcpip_backend_p.h │ ├── qconnectionfactories.cpp │ ├── qconnectionfactories.h │ ├── qconnectionfactories_p.h │ ├── qremoteobjectabstractitemmodeladapter.cpp │ ├── qremoteobjectabstractitemmodeladapter_p.h │ ├── qremoteobjectabstractitemmodelreplica.cpp │ ├── qremoteobjectabstractitemmodelreplica.h │ ├── qremoteobjectabstractitemmodelreplica_p.h │ ├── qremoteobjectabstractitemmodeltypes_p.h │ ├── qremoteobjectcontainers.cpp │ ├── qremoteobjectcontainers_p.h │ ├── qremoteobjectdynamicreplica.cpp │ ├── qremoteobjectdynamicreplica.h │ ├── qremoteobjectnode.cpp │ ├── qremoteobjectnode.h │ ├── qremoteobjectnode_p.h │ ├── qremoteobjectpacket.cpp │ ├── qremoteobjectpacket_p.h │ ├── qremoteobjectpendingcall.cpp │ ├── qremoteobjectpendingcall.h │ ├── qremoteobjectpendingcall_p.h │ ├── qremoteobjectregistry.cpp │ ├── qremoteobjectregistry.h │ ├── qremoteobjectregistrysource.cpp │ ├── qremoteobjectregistrysource_p.h │ ├── qremoteobjectreplica.cpp │ ├── qremoteobjectreplica.h │ ├── qremoteobjectreplica_p.h │ ├── qremoteobjectrepparser.cpp │ ├── qremoteobjectrepparser_p.h │ ├── qremoteobjectsettingsstore.cpp │ ├── qremoteobjectsettingsstore.h │ ├── qremoteobjectsource.cpp │ ├── qremoteobjectsource.h │ ├── qremoteobjectsource_p.h │ ├── qremoteobjectsourceio.cpp │ ├── qremoteobjectsourceio_p.h │ ├── qremoteobjectstructs_p.h │ ├── qtremoteobjectglobal.cpp │ └── qtremoteobjectglobal.h ├── remoteobjectsqml │ ├── CMakeLists.txt │ └── qremoteobjectsqml_p.h └── repparser │ ├── CMakeLists.txt │ ├── parser.g │ └── qregexparser.h ├── tests ├── CMakeLists.txt ├── auto │ ├── CMakeLists.txt │ ├── benchmarks │ │ ├── CMakeLists.txt │ │ └── tst_benchmarkstest.cpp │ ├── bic │ │ └── data │ │ │ ├── QtRemoteObjects.5.13.0.linux-gcc-amd64.txt │ │ │ └── QtRemoteObjects.5.14.0.linux-gcc-amd64.txt │ ├── cmake │ │ ├── CMakeLists.txt │ │ └── test_cmake_macros │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ ├── external_IODevice │ │ ├── CMakeLists.txt │ │ ├── cert │ │ │ ├── client.crt │ │ │ ├── client.key │ │ │ ├── generate.sh │ │ │ ├── rootCA.key │ │ │ ├── rootCA.pem │ │ │ ├── rootCA.srl │ │ │ ├── server-req.ext │ │ │ ├── server.crt │ │ │ └── server.key │ │ ├── pingpong.rep │ │ ├── sslTestServer │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ ├── pingpong.cpp │ │ │ ├── pingpong.h │ │ │ ├── sslserver.cpp │ │ │ └── sslserver.h │ │ └── tst_client │ │ │ ├── CMakeLists.txt │ │ │ └── tst_client.cpp │ ├── integration │ │ ├── CMakeLists.txt │ │ ├── engine.cpp │ │ ├── engine.h │ │ ├── engine.rep │ │ ├── enum.rep │ │ ├── pod.rep │ │ ├── speedometer.cpp │ │ ├── speedometer.h │ │ ├── speedometer.rep │ │ ├── temperature.h │ │ └── tst_integration.cpp │ ├── integration_external │ │ ├── CMakeLists.txt │ │ ├── MyInterface.rep │ │ ├── client │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── external │ │ │ ├── CMakeLists.txt │ │ │ └── tst_integration_external.cpp │ │ └── server │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ ├── mytestserver.cpp │ │ │ └── mytestserver.h │ ├── integration_multiprocess │ │ ├── CMakeLists.txt │ │ ├── ExtPodInterface.rep │ │ ├── MyInterface.rep │ │ ├── PodInterface.rep │ │ ├── client │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── server │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ ├── mytestserver.cpp │ │ │ └── mytestserver.h │ │ └── tst │ │ │ ├── CMakeLists.txt │ │ │ └── tst_integration_multiprocess.cpp │ ├── localserveroption │ │ ├── CMakeLists.txt │ │ └── tst_localserveroption.cpp │ ├── localsockettestserver │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── modelreplica │ │ ├── CMakeLists.txt │ │ ├── model.rep │ │ └── tst_modelreplicatest.cpp │ ├── modelview │ │ ├── CMakeLists.txt │ │ └── tst_modelview.cpp │ ├── pods │ │ ├── CMakeLists.txt │ │ ├── pods.h │ │ └── tst_pods.cpp │ ├── proxy │ │ ├── CMakeLists.txt │ │ ├── engine.rep │ │ ├── subclass.rep │ │ └── tst_proxy.cpp │ ├── proxy_multiprocess │ │ ├── CMakeLists.txt │ │ ├── client │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── namespace.h │ │ ├── proxy │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── server │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ ├── mytestserver.cpp │ │ │ └── mytestserver.h │ │ ├── shared.h │ │ ├── subclass.rep │ │ └── tst │ │ │ ├── CMakeLists.txt │ │ │ └── tst_proxy_multiprocess.cpp │ ├── qml │ │ ├── CMakeLists.txt │ │ ├── integration │ │ │ ├── CMakeLists.txt │ │ │ ├── data │ │ │ │ └── tst_integration.qml │ │ │ └── tst_integration.cpp │ │ └── usertypes │ │ │ ├── CMakeLists.txt │ │ │ ├── data │ │ │ ├── MyType.qml │ │ │ ├── complex.qml │ │ │ ├── composite.qml │ │ │ ├── extraPropComplex.qml │ │ │ ├── extraprop.qml │ │ │ ├── extraprop2.qml │ │ │ ├── hosted.qml │ │ │ ├── model.qml │ │ │ ├── subObject.qml │ │ │ ├── twoReplicas.qml │ │ │ └── watcher.qml │ │ │ ├── tst_usertypes.cpp │ │ │ └── usertypes.rep │ ├── reconnect │ │ ├── CMakeLists.txt │ │ ├── client │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── server │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ └── tst │ │ │ ├── CMakeLists.txt │ │ │ └── tst_reconnect.cpp │ ├── rep_from_header │ │ ├── CMakeLists.txt │ │ ├── pods.h │ │ └── tst_rep_from_header.cpp │ ├── repc │ │ ├── CMakeLists.txt │ │ ├── enums │ │ │ ├── CMakeLists.txt │ │ │ ├── enums.rep │ │ │ └── tst_enums.cpp │ │ ├── pods │ │ │ ├── CMakeLists.txt │ │ │ ├── pods.rep │ │ │ └── tst_pods.cpp │ │ └── signature │ │ │ ├── CMakeLists.txt │ │ │ ├── differentClassEnum │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentGlobalEnum │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentPropertyCount │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentPropertyCountChild │ │ │ ├── CMakeLists.txt │ │ │ ├── differentPropertyCountChild.pro │ │ │ └── mismatch.rep │ │ │ ├── differentPropertyType │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentSignalCount │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentSignalParamCount │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentSignalParamType │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentSlotCount │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentSlotParamCount │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentSlotParamType │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── differentSlotType │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── matchAndQuit │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ │ ├── mismatch.cpp │ │ │ ├── mismatch.pri │ │ │ ├── scrambledProperties │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── scrambledSignals │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── scrambledSlots │ │ │ ├── CMakeLists.txt │ │ │ └── mismatch.rep │ │ │ ├── server.rep │ │ │ ├── signatureServer │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ │ ├── signatureTests │ │ │ ├── CMakeLists.txt │ │ │ └── tst_signature.cpp │ │ │ └── state │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── mismatch.rep │ ├── repcinlib │ │ ├── CMakeLists.txt │ │ ├── classwithattributetest.rep │ │ ├── export_header.h │ │ └── tst_repcinlib.cpp │ ├── repcodegenerator │ │ ├── CMakeLists.txt │ │ ├── classinnamespace.rep │ │ ├── classwithattributetest.rep │ │ ├── classwithreadonlypropertytest.rep │ │ ├── classwithsignalonlytest.rep │ │ ├── preprocessortest.rep │ │ └── tst_repcodegenerator.cpp │ ├── repfiles │ │ ├── localdatacenter.rep │ │ └── tcpdatacenter.rep │ ├── repparser │ │ ├── CMakeLists.txt │ │ └── tst_parser.cpp │ ├── restart │ │ ├── CMakeLists.txt │ │ ├── client │ │ │ ├── CMakeLists.txt │ │ │ └── main.cpp │ │ ├── server │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ ├── mytestserver.cpp │ │ │ └── mytestserver.h │ │ ├── subclass.rep │ │ └── tst │ │ │ ├── CMakeLists.txt │ │ │ └── tst_restart.cpp │ ├── shared │ │ └── model_utilities.h │ └── subclassreplica │ │ ├── CMakeLists.txt │ │ ├── class.rep │ │ └── tst_subclassreplicatest.cpp ├── global │ └── global.cfg ├── manual │ ├── CMakeLists.txt │ └── examples │ │ ├── CMakeLists.txt │ │ ├── ble │ │ ├── CMakeLists.txt │ │ ├── ble.pro │ │ ├── bleclient │ │ │ ├── CMakeLists.txt │ │ │ ├── bleclient.pro │ │ │ ├── connectpage.cpp │ │ │ ├── connectpage.h │ │ │ ├── connectpage.ui │ │ │ ├── heaterview.cpp │ │ │ ├── heaterview.h │ │ │ ├── heaterview.ui │ │ │ ├── main.cpp │ │ │ ├── mainwindow.cpp │ │ │ └── mainwindow.h │ │ ├── bleserver │ │ │ ├── CMakeLists.txt │ │ │ ├── bleserver.pro │ │ │ └── main.cpp │ │ ├── common │ │ │ ├── Info.cmake.macos.plist │ │ │ ├── Info.ios.plist │ │ │ ├── Info.qmake.macos.plist │ │ │ ├── bleiodevice.cpp │ │ │ ├── bleiodevice.h │ │ │ ├── common.pri │ │ │ └── heater.rep │ │ └── doc │ │ │ └── src │ │ │ └── ble.qdoc │ │ ├── qmlmodelviewclient │ │ ├── CMakeLists.txt │ │ ├── doc │ │ │ └── src │ │ │ │ └── qmlmodelviewclient.qdoc │ │ ├── main.cpp │ │ ├── main.qml │ │ ├── qml.qrc │ │ └── qmlmodelviewclient.pro │ │ └── simpleswitch │ │ ├── CMakeLists.txt │ │ ├── directconnectdynamicclient │ │ ├── CMakeLists.txt │ │ ├── directconnectdynamicclient.pro │ │ ├── dynamicclient.cpp │ │ ├── dynamicclient.h │ │ └── main.cpp │ │ ├── registryconnectedclient │ │ ├── CMakeLists.txt │ │ ├── dynamicclient.cpp │ │ ├── dynamicclient.h │ │ ├── main.cpp │ │ └── registryconnectedclient.pro │ │ ├── registryconnectedserver │ │ ├── CMakeLists.txt │ │ ├── main.cpp │ │ ├── registryconnectedserver.pro │ │ ├── simpleswitch.cpp │ │ ├── simpleswitch.h │ │ └── simpleswitch.rep │ │ └── simpleswitch.pro └── shared │ └── testutils.h └── tools ├── CMakeLists.txt ├── repc ├── CMakeLists.txt ├── cppcodegenerator.cpp ├── cppcodegenerator.h ├── main.cpp ├── repc.pro ├── repcodegenerator.cpp ├── repcodegenerator.h ├── utils.cpp └── utils.h └── tools.pro /.cmake.conf: -------------------------------------------------------------------------------- 1 | set(QT_REPO_MODULE_VERSION "6.10.0") 2 | set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1") 3 | set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_AS_CONST=1") 4 | list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1") 5 | list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_CONTEXTLESS_CONNECT=1") 6 | -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=codereview.qt-project.org 3 | project=qt/qtremoteobjects 4 | defaultbranch=dev 5 | -------------------------------------------------------------------------------- /.tag: -------------------------------------------------------------------------------- 1 | 37a489062d2e87e9456eb9759afb7689c8ed56f6 2 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | 6 | include(.cmake.conf) 7 | project(QtRemoteObjects 8 | VERSION "${QT_REPO_MODULE_VERSION}" 9 | DESCRIPTION "Qt RemoteObjects Libraries" 10 | HOMEPAGE_URL "https://qt.io/" 11 | LANGUAGES CXX C 12 | ) 13 | 14 | find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Network) 15 | find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Gui Widgets Quick QuickTest Bluetooth WebSockets) 16 | qt_internal_project_setup() 17 | 18 | if(NOT TARGET Qt::Network) 19 | message(NOTICE "Skipping the build as the condition \"TARGET Qt::Network\" is not met.") 20 | return() 21 | endif() 22 | qt_build_repo() 23 | 24 | if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILD_STANDALONE_EXAMPLES) 25 | # Copy mkspecs for users preferring qmake builds 26 | set(mkspecs_install_dir "${INSTALL_MKSPECSDIR}") 27 | qt_path_join(mkspecs_install_dir ${QT_INSTALL_DIR} ${mkspecs_install_dir}) 28 | 29 | qt_copy_or_install(DIRECTORY mkspecs/ 30 | DESTINATION "${mkspecs_install_dir}" 31 | FILES_MATCHING PATTERN "*.pr[if]" 32 | ) 33 | endif() 34 | -------------------------------------------------------------------------------- /LICENSES/LicenseRef-Qt-Commercial.txt: -------------------------------------------------------------------------------- 1 | Licensees holding valid commercial Qt licenses may use this software in 2 | accordance with the the terms contained in a written agreement between 3 | you and The Qt Company. Alternatively, the terms and conditions that were 4 | accepted by the licensee when buying and/or downloading the 5 | software do apply. 6 | 7 | For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions. 8 | For further information use the contact form at https://www.qt.io/contact-us. 9 | -------------------------------------------------------------------------------- /LICENSES/Qt-GPL-exception-1.0.txt: -------------------------------------------------------------------------------- 1 | The Qt Company GPL Exception 1.0 2 | 3 | Exception 1: 4 | 5 | As a special exception you may create a larger work which contains the 6 | output of this application and distribute that work under terms of your 7 | choice, so long as the work is not otherwise derived from or based on 8 | this application and so long as the work does not in itself generate 9 | output that contains the output from this application in its original 10 | or modified form. 11 | 12 | Exception 2: 13 | 14 | As a special exception, you have permission to combine this application 15 | with Plugins licensed under the terms of your choice, to produce an 16 | executable, and to copy and distribute the resulting executable under 17 | the terms of your choice. However, the executable must be accompanied 18 | by a prominent notice offering all users of the executable the entire 19 | source code to this application, excluding the source code of the 20 | independent modules, but including any changes you have made to this 21 | application, under the terms of this license. 22 | 23 | -------------------------------------------------------------------------------- /coin/axivion/ci_config_linux.json: -------------------------------------------------------------------------------- 1 | { 2 | "Project": { 3 | "BuildSystemIntegration": { 4 | "child_order": [ 5 | "GCCSetup", 6 | "CMake", 7 | "LinkLibraries" 8 | ] 9 | }, 10 | "CMake": { 11 | "_active": true, 12 | "_copy_from": "CMakeIntegration", 13 | "build_environment": {}, 14 | "build_options": "-j4", 15 | "generate_options": "--fresh", 16 | "generator": "Ninja" 17 | }, 18 | "GCCSetup": { 19 | "_active": true, 20 | "_copy_from": "Command", 21 | "build_command": "gccsetup --cc gcc --cxx g++ --config ../../../axivion/" 22 | }, 23 | "LinkLibraries": { 24 | "_active": true, 25 | "_copy_from": "AxivionLinker", 26 | "input_files": [ 27 | "build/lib/lib*.so*.ir", 28 | "build/qml/*/lib*.so*.ir" 29 | ], 30 | "ir": "build/$(env:TESTED_MODULE_COIN).ir" 31 | } 32 | }, 33 | "_Format": "1.0", 34 | "_Version": "7.6.2", 35 | "_VersionNum": [ 36 | 7, 37 | 6, 38 | 2, 39 | 12725 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /coin/module_config.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | accept_configuration: 3 | condition: property 4 | property: features 5 | not_contains_value: Disable 6 | 7 | instructions: 8 | Build: 9 | - type: EnvironmentVariable 10 | variableName: VERIFY_SOURCE_SBOM 11 | variableValue: "ON" 12 | - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" 13 | 14 | Test: 15 | - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml" 16 | - !include "{{qt/qtbase}}/coin_module_test_docs.yaml" 17 | -------------------------------------------------------------------------------- /dependencies.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | ../qtbase: 3 | ref: a867a16ef0a29f9b8b7196d0959e980ee17d7876 4 | required: true 5 | ../qtdeclarative: 6 | ref: fa4568622cc19e5a876238d6cfca2e95936f8bdd 7 | required: false 8 | -------------------------------------------------------------------------------- /dist/REUSE.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | [[annotations]] 4 | path = ["*"] 5 | precedence = "override" 6 | comment = "Licensed as documentation." 7 | SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd." 8 | SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only" 9 | -------------------------------------------------------------------------------- /dist/changes-5.11.1: -------------------------------------------------------------------------------- 1 | Qt 5.11.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.11.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | Note: Tech Preview modules are able to change APIs to refine or enhance the 10 | module's functionality. Thus Qt's binary compatibility quarantees aren't 11 | applicable. Code switching to 5.11.0 from earlier versions of Qt Remote 12 | Objects will need to be recompiled. 13 | 14 | Some of the changes listed in this file include issue tracking numbers 15 | corresponding to tasks in the Qt Bug Tracker: 16 | 17 | https://bugreports.qt.io/ 18 | 19 | Each of these identifiers can be entered in the bug tracker to obtain more 20 | information about a particular change. 21 | 22 | **************************************************************************** 23 | * Qt 5.11.1 Changes * 24 | **************************************************************************** 25 | 26 | - This release contains several fixes for MODEL/SUBCLASS handling and tests. 27 | -------------------------------------------------------------------------------- /dist/changes-5.11.2: -------------------------------------------------------------------------------- 1 | Qt 5.11.2 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.11.0 through 5.11.1. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.11 series is binary compatible with the 5.10.x series. 10 | Applications compiled for 5.10 will continue to run with 5.11. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | **************************************************************************** 21 | * Qt 5.11.2 Changes * 22 | **************************************************************************** 23 | 24 | - This release contains only minor code improvements. 25 | -------------------------------------------------------------------------------- /dist/changes-5.11.3: -------------------------------------------------------------------------------- 1 | Qt 5.11.3 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.11.0 through 5.11.2. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | http://doc.qt.io/qt-5/index.html 8 | 9 | Note: Tech Preview modules are able to change APIs to refine or enhance the 10 | module's functionality. Thus Qt's binary compatibility quarantees aren't 11 | applicable. Code switching to 5.11.0 from earlier versions of Qt Remote 12 | Objects will need to be recompiled. 13 | 14 | Some of the changes listed in this file include issue tracking numbers 15 | corresponding to tasks in the Qt Bug Tracker: 16 | 17 | https://bugreports.qt.io/ 18 | 19 | Each of these identifiers can be entered in the bug tracker to obtain more 20 | information about a particular change. 21 | 22 | **************************************************************************** 23 | * Qt 5.11.3 Changes * 24 | **************************************************************************** 25 | 26 | - QRemoteObjectNode 27 | * Fix a constant reconnect issue 28 | -------------------------------------------------------------------------------- /dist/changes-5.12.2: -------------------------------------------------------------------------------- 1 | Qt 5.12.2 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.12.0 through 5.12.1. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.12 series is binary compatible with the 5.11.x series. 10 | Applications compiled for 5.11 will continue to run with 5.12. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /dist/changes-5.12.5: -------------------------------------------------------------------------------- 1 | Qt 5.12.5 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.12.0 through 5.12.4. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.12 series is binary compatible with the 5.11.x series. 10 | Applications compiled for 5.11 will continue to run with 5.12. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /dist/changes-5.13.1: -------------------------------------------------------------------------------- 1 | Qt 5.13.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.13.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.13 series is binary compatible with the 5.12.x series. 10 | Applications compiled for 5.12 will continue to run with 5.13. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - Improved clarity and consistency of documentation. 21 | - Made a number of fixes and improvements in the handling of enumerations. 22 | -------------------------------------------------------------------------------- /dist/changes-5.14.0: -------------------------------------------------------------------------------- 1 | Qt 5.14 introduces many new features and improvements as well as bugfixes 2 | over the 5.13.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | https://doc.qt.io/qt-5/index.html 6 | 7 | The Qt version 5.14 series is binary compatible with the 5.13.x series. 8 | Applications compiled for 5.13 will continue to run with 5.14. 9 | 10 | If you are using Qt Remote Objects between proesses or devices running 11 | different versions Qt, the different versions of Qt must be running 12 | compatible versions of QtRO's protocol. Changes to the Qt Remote Objects 13 | protocol are documented online: 14 | 15 | https://doc.qt.io/qt-5/qtremoteobjects-compatibility.html 16 | 17 | Some of the changes listed in this file include issue tracking numbers 18 | corresponding to tasks in the Qt Bug Tracker: 19 | 20 | https://bugreports.qt.io/ 21 | 22 | Each of these identifiers can be entered in the bug tracker to obtain more 23 | information about a particular change. 24 | 25 | - QTBUG-77178 Support SLOTs with return values in QML 26 | -------------------------------------------------------------------------------- /dist/changes-5.14.1: -------------------------------------------------------------------------------- 1 | Qt 5.14.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.14.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.14 series is binary compatible with the 5.13.x series. 10 | Applications compiled for 5.13 will continue to run with 5.14. 11 | 12 | If you are using Qt Remote Objects between processes or devices running 13 | different versions Qt, the different versions of Qt must be running 14 | compatible versions of QtRO's protocol. Changes to the Qt Remote Objects 15 | protocol are documented online: 16 | 17 | https://doc.qt.io/qt-5/qtremoteobjects-compatibility.html 18 | 19 | Some of the changes listed in this file include issue tracking numbers 20 | corresponding to tasks in the Qt Bug Tracker: 21 | 22 | https://bugreports.qt.io/ 23 | 24 | Each of these identifiers can be entered in the bug tracker to obtain more 25 | information about a particular change. 26 | 27 | - This release contains only minor code improvements. 28 | -------------------------------------------------------------------------------- /dist/changes-5.14.2: -------------------------------------------------------------------------------- 1 | Qt 5.14.2 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.14.0 through 5.14.1. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.14 series is binary compatible with the 5.13.x series. 10 | Applications compiled for 5.13 will continue to run with 5.14. 11 | 12 | If you are using Qt Remote Objects between processes or devices running 13 | different versions Qt, the different versions of Qt must be running 14 | compatible versions of QtRO's protocol. Changes to the Qt Remote Objects 15 | protocol are documented online: 16 | 17 | https://doc.qt.io/qt-5/qtremoteobjects-compatibility.html 18 | 19 | Some of the changes listed in this file include issue tracking numbers 20 | corresponding to tasks in the Qt Bug Tracker: 21 | 22 | https://bugreports.qt.io/ 23 | 24 | Each of these identifiers can be entered in the bug tracker to obtain more 25 | information about a particular change. 26 | 27 | - This release contains only minor code improvements. 28 | -------------------------------------------------------------------------------- /dist/changes-5.15.0: -------------------------------------------------------------------------------- 1 | Qt 5.15 introduces many new features and improvements as well as bugfixes 2 | over the 5.14.x series. For more details, refer to the online documentation 3 | included in this distribution. The documentation is also available online: 4 | 5 | https://doc.qt.io/qt-5/index.html 6 | 7 | The Qt version 5.15 series is binary compatible with the 5.14.x series. 8 | Applications compiled for 5.14 will continue to run with 5.15. 9 | 10 | Some of the changes listed in this file include issue tracking numbers 11 | corresponding to tasks in the Qt Bug Tracker: 12 | 13 | https://bugreports.qt.io/ 14 | 15 | Each of these identifiers can be entered in the bug tracker to obtain more 16 | information about a particular change. 17 | 18 | **************************************************************************** 19 | * QML * 20 | **************************************************************************** 21 | 22 | - Exposed Host to enable remoting of source objects from QML. 23 | -------------------------------------------------------------------------------- /dist/changes-5.15.1: -------------------------------------------------------------------------------- 1 | Qt 5.15.1 is a bug-fix release. It maintains both forward and backward 2 | compatibility (source and binary) with Qt 5.15.0. 3 | 4 | For more details, refer to the online documentation included in this 5 | distribution. The documentation is also available online: 6 | 7 | https://doc.qt.io/qt-5/index.html 8 | 9 | The Qt version 5.15 series is binary compatible with the 5.14.x series. 10 | Applications compiled for 5.14 will continue to run with 5.15. 11 | 12 | Some of the changes listed in this file include issue tracking numbers 13 | corresponding to tasks in the Qt Bug Tracker: 14 | 15 | https://bugreports.qt.io/ 16 | 17 | Each of these identifiers can be entered in the bug tracker to obtain more 18 | information about a particular change. 19 | 20 | - This release contains only minor code improvements. 21 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | qt_examples_build_begin(EXTERNAL_BUILD) 5 | 6 | add_subdirectory(remoteobjects) 7 | 8 | qt_examples_build_end() 9 | -------------------------------------------------------------------------------- /examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS = \ 3 | remoteobjects 4 | -------------------------------------------------------------------------------- /examples/remoteobjects/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | if (NOT ANDROID) 5 | qt_internal_add_example(remoteobjects_server) 6 | qt_internal_add_example(simpleswitch) 7 | endif() 8 | add_subdirectory(websockets) 9 | if(TARGET Qt::Widgets) 10 | qt_internal_add_example(modelviewclient) 11 | qt_internal_add_example(modelviewserver) 12 | endif() 13 | if(QT_FEATURE_ssl AND NOT ANDROID) 14 | qt_internal_add_example(ssl) 15 | endif() 16 | if(TARGET Qt::Quick) 17 | qt_internal_add_example(clientapp) 18 | endif() 19 | -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/Plugins.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | import QtQuick 5 | 6 | Window { 7 | id: window 8 | width: 200 9 | height: 400 10 | visible: true 11 | property int counter: 0; 12 | MouseArea { 13 | anchors.fill: parent 14 | onClicked: 15 | { 16 | window.counter = (window.counter + 1) % 3; 17 | pageLoader.source = "plugins"+window.counter+".qml" 18 | } 19 | } 20 | Loader { 21 | id: pageLoader 22 | source: "plugins0.qml" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/examples/remoteobjects/clientapp/center.png -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/clientapp.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | TARGET = clientapp 3 | 4 | QT += remoteobjects quick 5 | 6 | CONFIG += qmltypes 7 | 8 | REPC_REPLICA += $$PWD/../timemodel.rep 9 | 10 | QML_IMPORT_NAME = TimeExample 11 | QML_IMPORT_MAJOR_VERSION = 1 12 | 13 | SOURCES += main.cpp 14 | HEADERS += plugin.h 15 | 16 | qml_resources.files = \ 17 | qmldir \ 18 | Plugins.qml \ 19 | plugins0.qml \ 20 | plugins1.qml \ 21 | plugins2.qml \ 22 | Clock.qml \ 23 | center.png \ 24 | clock.png \ 25 | hour.png \ 26 | minute.png 27 | 28 | qml_resources.prefix = /qt/qml/TimeExample 29 | 30 | RESOURCES += qml_resources 31 | 32 | contains(QT_CONFIG, c++11): CONFIG += c++11 33 | 34 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/clientapp 35 | INSTALLS += target 36 | -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/examples/remoteobjects/clientapp/clock.png -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/doc/images/clientapp-example.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/examples/remoteobjects/clientapp/doc/images/clientapp-example.webp -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/hour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/examples/remoteobjects/clientapp/hour.png -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QGuiApplication app(argc, argv); 10 | 11 | QQmlApplicationEngine engine; 12 | QObject::connect( 13 | &engine, &QQmlApplicationEngine::objectCreationFailed, &app, 14 | []() { QCoreApplication::exit(1); }, Qt::QueuedConnection); 15 | engine.loadFromModule("TimeExample", "Plugins"); 16 | return app.exec(); 17 | } 18 | -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/minute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/examples/remoteobjects/clientapp/minute.png -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/plugin.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | #include "rep_timemodel_replica.h" 7 | 8 | // A "TimeModel" class with hour and minute properties 9 | // that change on-the-minute yet efficiently sleep the rest 10 | // of the time. 11 | 12 | struct TimeModel 13 | { 14 | Q_GADGET 15 | QML_FOREIGN(MinuteTimerReplica) 16 | QML_NAMED_ELEMENT(Time) 17 | }; 18 | -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/plugins0.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | //![0] 4 | import QtQuick 5 | import QtRemoteObjects 6 | import TimeExample // import types from the plugin 7 | 8 | Rectangle { 9 | width: 200 10 | height: 400 11 | color: "blue" 12 | 13 | Node { 14 | id: node 15 | registryUrl: "local:registry" 16 | } 17 | 18 | Time { // this class is defined in C++ 19 | id: time 20 | node: node 21 | } 22 | 23 | Text { 24 | id: validity; font.bold: true; font.pixelSize: 14; y:200; color: "white" 25 | anchors.horizontalCenter: parent.horizontalCenter 26 | text: time.state == Time.Valid ? "Click to see a clock!" : "Server not found" 27 | } 28 | } 29 | //![0] 30 | -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/plugins1.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | import QtRemoteObjects 5 | import QtQuick 6 | import TimeExample // import types from the plugin 7 | 8 | Rectangle { 9 | width: 200 10 | height: 400 11 | color: "blue" 12 | Clock { 13 | id: clock1 14 | anchors.top: parent.top 15 | 16 | Time { // this class is defined in C++ 17 | id: time 18 | node: node 19 | } 20 | 21 | Node { 22 | id: node 23 | registryUrl: "local:registry" 24 | } 25 | 26 | hours: time.hour 27 | minutes: time.minute 28 | valid: time.state == Time.Valid 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/plugins2.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | //![0] 4 | import QtQuick 5 | import QtRemoteObjects 6 | import TimeExample // import types from the plugin 7 | 8 | Rectangle { 9 | width: 200 10 | height: 400 11 | Clock { // this class is defined in QML 12 | id: clock1 13 | anchors.top: parent.top 14 | 15 | Time { // this class is defined in C++ 16 | id: time 17 | node: sharedNode 18 | } 19 | 20 | hours: time.hour 21 | minutes: time.minute 22 | valid: time.state == Time.Valid 23 | 24 | } 25 | Clock { // this class is defined in QML 26 | id: clock2 27 | anchors.top: clock1.bottom 28 | 29 | Time { // this class is defined in C++ 30 | id: time2 31 | node: sharedNode 32 | } 33 | 34 | hours: time2.hour 35 | minutes: time2.minute 36 | valid: time2.state == Time.Valid 37 | 38 | } 39 | 40 | Node { 41 | id: sharedNode 42 | registryUrl: "local:registry" 43 | } 44 | 45 | } 46 | //![0] 47 | -------------------------------------------------------------------------------- /examples/remoteobjects/clientapp/qmldir: -------------------------------------------------------------------------------- 1 | module TimeExample 2 | typeinfo clientapp.qmltypes 3 | prefer :/qt/qml/TimeExample/ 4 | Clock 1.0 Clock.qml 5 | Plugins 1.0 Plugins.qml 6 | -------------------------------------------------------------------------------- /examples/remoteobjects/modelviewclient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(modelviewclient LANGUAGES CXX) 6 | 7 | set(CMAKE_AUTOMOC ON) 8 | 9 | if(NOT DEFINED INSTALL_EXAMPLESDIR) 10 | set(INSTALL_EXAMPLESDIR "examples") 11 | endif() 12 | 13 | set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/remoteobjects/modelviewclient") 14 | 15 | find_package(Qt6 REQUIRED COMPONENTS Core Gui RemoteObjects Widgets) 16 | 17 | qt_add_executable(modelviewclient 18 | main.cpp 19 | ) 20 | 21 | set_target_properties(modelviewclient PROPERTIES 22 | WIN32_EXECUTABLE TRUE 23 | MACOSX_BUNDLE FALSE 24 | ) 25 | 26 | target_link_libraries(modelviewclient PUBLIC 27 | Qt::Core 28 | Qt::Gui 29 | Qt::RemoteObjects 30 | Qt::Widgets 31 | ) 32 | 33 | install(TARGETS modelviewclient 34 | RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" 35 | BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" 36 | LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" 37 | ) 38 | -------------------------------------------------------------------------------- /examples/remoteobjects/modelviewclient/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | int main(int argc, char **argv) 10 | { 11 | 12 | QLoggingCategory::setFilterRules("qt.remoteobjects.debug=false\n" 13 | "qt.remoteobjects.warning=false\n" 14 | "qt.remoteobjects.models.debug=false\n" 15 | "qt.remoteobjects.models.debug=false"); 16 | 17 | QApplication app(argc, argv); 18 | 19 | //! [ObjectNode creation] 20 | QRemoteObjectNode node(QUrl(QStringLiteral("local:registry"))); 21 | node.setHeartbeatInterval(1000); 22 | //! [ObjectNode creation] 23 | //! [Model acquisition] 24 | QScopedPointer model(node.acquireModel(QStringLiteral("RemoteModel"))); 25 | //! [Model acquisition] 26 | 27 | //! [QTreeView-creation] 28 | QTreeView view; 29 | view.setWindowTitle(QStringLiteral("RemoteView")); 30 | view.resize(640,480); 31 | view.setModel(model.data()); 32 | view.show(); 33 | //! [QTreeView-creation] 34 | 35 | return app.exec(); 36 | } 37 | -------------------------------------------------------------------------------- /examples/remoteobjects/modelviewclient/modelviewclient.pro: -------------------------------------------------------------------------------- 1 | SOURCES = main.cpp 2 | 3 | CONFIG -= app_bundle 4 | 5 | # install 6 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/modelviewclient 7 | INSTALLS += target 8 | 9 | QT += widgets remoteobjects 10 | requires(qtConfig(treeview)) 11 | -------------------------------------------------------------------------------- /examples/remoteobjects/modelviewserver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(modelviewserver LANGUAGES CXX) 6 | 7 | set(CMAKE_AUTOMOC ON) 8 | 9 | if(NOT DEFINED INSTALL_EXAMPLESDIR) 10 | set(INSTALL_EXAMPLESDIR "examples") 11 | endif() 12 | 13 | set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/remoteobjects/modelviewserver") 14 | 15 | find_package(Qt6 REQUIRED COMPONENTS Core Gui RemoteObjects Widgets) 16 | 17 | qt_add_executable(modelviewserver 18 | main.cpp 19 | ) 20 | 21 | set_target_properties(modelviewserver PROPERTIES 22 | WIN32_EXECUTABLE TRUE 23 | MACOSX_BUNDLE TRUE 24 | ) 25 | 26 | target_link_libraries(modelviewserver PUBLIC 27 | Qt::Core 28 | Qt::Gui 29 | Qt::RemoteObjects 30 | Qt::Widgets 31 | ) 32 | 33 | install(TARGETS modelviewserver 34 | RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" 35 | BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" 36 | LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" 37 | ) 38 | -------------------------------------------------------------------------------- /examples/remoteobjects/modelviewserver/modelviewserver.pro: -------------------------------------------------------------------------------- 1 | QT += widgets remoteobjects 2 | requires(qtConfig(treeview)) 3 | 4 | TEMPLATE = app 5 | 6 | CONFIG += c++11 7 | 8 | SOURCES += main.cpp 9 | 10 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/modelviewserver 11 | INSTALLS += target 12 | -------------------------------------------------------------------------------- /examples/remoteobjects/remoteobjects.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | CONFIG += debug_and_release ordered 3 | SUBDIRS = \ 4 | remoteobjects_server \ 5 | simpleswitch \ 6 | websockets 7 | 8 | qtHaveModule(widgets) { 9 | SUBDIRS += \ 10 | modelviewclient \ 11 | modelviewserver 12 | } 13 | 14 | contains(QT_CONFIG, ssl): SUBDIRS += ssl 15 | 16 | qtHaveModule(quick) { 17 | SUBDIRS += \ 18 | clientapp 19 | 20 | } 21 | -------------------------------------------------------------------------------- /examples/remoteobjects/remoteobjects_server/doc/images/remoteobjects-server-example.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/examples/remoteobjects/remoteobjects_server/doc/images/remoteobjects-server-example.webp -------------------------------------------------------------------------------- /examples/remoteobjects/remoteobjects_server/remoteobjects_server.pro: -------------------------------------------------------------------------------- 1 | CONFIG += console 2 | 3 | 4 | REPC_SOURCE += ../timemodel.rep 5 | QT = remoteobjects core 6 | 7 | SOURCES += timemodel.cpp main.cpp 8 | HEADERS += timemodel.h 9 | 10 | contains(QT_CONFIG, c++11): CONFIG += c++11 11 | 12 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/remoteobjects_server 13 | INSTALLS += target 14 | -------------------------------------------------------------------------------- /examples/remoteobjects/remoteobjects_server/timemodel.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include "timemodel.h" 5 | 6 | MinuteTimer::MinuteTimer(QObject *parent) : MinuteTimerSimpleSource(parent), zone(0) 7 | { 8 | time = QTime::currentTime(); 9 | setHour(time.hour()); 10 | setMinute(time.minute()); 11 | timer.start(60000-time.second()*1000, this); 12 | } 13 | 14 | MinuteTimer::~MinuteTimer() 15 | { 16 | timer.stop(); 17 | } 18 | 19 | //![0] 20 | void MinuteTimer::timerEvent(QTimerEvent *) 21 | { 22 | QTime now = QTime::currentTime(); 23 | if (now.second() == 59 && now.minute() == time.minute() && now.hour() == time.hour()) { 24 | // just missed time tick over, force it, wait extra 0.5 seconds 25 | time = time.addSecs(60); 26 | timer.start(60500, this); 27 | } else { 28 | time = now; 29 | timer.start(60000-time.second()*1000, this); 30 | } 31 | qDebug()<<"Time"< 5 | #include "rep_timemodel_source.h" 6 | 7 | class MinuteTimer : public MinuteTimerSimpleSource 8 | { 9 | Q_OBJECT 10 | public: 11 | MinuteTimer(QObject *parent = nullptr); 12 | ~MinuteTimer() override; 13 | 14 | public slots: 15 | void SetTimeZone(const int &zn) override; 16 | 17 | protected: 18 | void timerEvent(QTimerEvent *) override; 19 | 20 | private: 21 | QTime time; 22 | QBasicTimer timer; 23 | int zone; 24 | }; 25 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(qtremoteobjects_simpleswitch) 6 | find_package(Qt6 REQUIRED COMPONENTS Core RemoteObjects) 7 | qt_standard_project_setup() 8 | add_subdirectory(directconnectclient) 9 | add_subdirectory(directconnectserver) 10 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/directconnectclient/client.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef _CLIENT_H 5 | #define _CLIENT_H 6 | 7 | #include 8 | #include 9 | 10 | #include "rep_simpleswitch_replica.h" 11 | 12 | class Client : public QObject 13 | { 14 | Q_OBJECT 15 | public: 16 | Client(QSharedPointer ptr); 17 | ~Client() override; 18 | void initConnections();// function connect signals and slots of source and client 19 | 20 | Q_SIGNALS: 21 | void echoSwitchState(bool switchState);// this signal is connected with server_slot(..) on the source object and echoes back switch state received from source 22 | 23 | public Q_SLOTS: 24 | void recSwitchState_slot(bool); // slot to receive source state 25 | private: 26 | bool clientSwitchState; // holds received server switch state 27 | QSharedPointer reptr;// holds reference to replica 28 | 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/directconnectclient/directconnectclient.pro: -------------------------------------------------------------------------------- 1 | QT += remoteobjects core 2 | 3 | QT -= gui 4 | 5 | TARGET = directconnectclient 6 | CONFIG += console 7 | CONFIG -= app_bundle 8 | 9 | REPC_REPLICA = simpleswitch.rep 10 | 11 | TEMPLATE = app 12 | 13 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/simpleswitch/directconnectclient 14 | INSTALLS += target 15 | 16 | SOURCES += main.cpp \ 17 | client.cpp 18 | 19 | HEADERS += \ 20 | client.h 21 | 22 | DISTFILES += \ 23 | simpleswitch.rep 24 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/directconnectclient/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include "client.h" 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QCoreApplication a(argc, argv); 10 | 11 | 12 | QSharedPointer ptr; 13 | 14 | QRemoteObjectNode repNode; // create remote object node 15 | repNode.connectToNode(QUrl(QStringLiteral("local:replica"))); // connect with remote host node 16 | 17 | ptr.reset(repNode.acquire()); // acquire replica of source from host node 18 | 19 | Client rswitch(ptr); // create client switch object and pass reference of replica to it 20 | 21 | return a.exec(); 22 | } 23 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/directconnectclient/simpleswitch.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class SimpleSwitch 4 | { 5 | PROP(bool currState=false); 6 | SLOT(void server_slot(bool clientState)); 7 | }; 8 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/directconnectserver/directconnectserver.pro: -------------------------------------------------------------------------------- 1 | QT += remoteobjects core 2 | 3 | QT -= gui 4 | 5 | TARGET = directconnectserver 6 | CONFIG += console 7 | CONFIG -= app_bundle 8 | 9 | REPC_SOURCE = simpleswitch.rep 10 | 11 | TEMPLATE = app 12 | 13 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/simpleswitch/directconnectserver 14 | INSTALLS += target 15 | 16 | SOURCES += main.cpp \ 17 | simpleswitch.cpp 18 | 19 | 20 | HEADERS += \ 21 | simpleswitch.h 22 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/directconnectserver/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include "simpleswitch.h" 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QCoreApplication a(argc, argv); 10 | 11 | SimpleSwitch srcSwitch; // create simple switch 12 | 13 | QRemoteObjectHost srcNode(QUrl(QStringLiteral("local:replica"))); // create host node without Registry 14 | srcNode.enableRemoting(&srcSwitch); // enable remoting/Sharing 15 | 16 | return a.exec(); 17 | } 18 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/directconnectserver/simpleswitch.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef SIMPLESWITCH_H 5 | #define SIMPLESWITCH_H 6 | 7 | #include "rep_simpleswitch_source.h" 8 | 9 | class SimpleSwitch : public SimpleSwitchSimpleSource 10 | { 11 | Q_OBJECT 12 | public: 13 | SimpleSwitch(QObject *parent = nullptr); 14 | ~SimpleSwitch() override; 15 | void server_slot(bool clientState) override; 16 | public Q_SLOTS: 17 | void timeout_slot(); 18 | private: 19 | QTimer *stateChangeTimer; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/directconnectserver/simpleswitch.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class SimpleSwitch 4 | { 5 | PROP(bool currState=false); 6 | SLOT(void server_slot(bool clientState)); 7 | }; 8 | -------------------------------------------------------------------------------- /examples/remoteobjects/simpleswitch/simpleswitch.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | directconnectclient \ 5 | directconnectserver 6 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(qtremoteobjects_ssl) 6 | find_package(Qt6 REQUIRED COMPONENTS Core RemoteObjects) 7 | qt_standard_project_setup() 8 | add_subdirectory(sslserver) 9 | add_subdirectory(sslcppclient) 10 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/ssl.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | CONFIG += debug_and_release ordered 3 | 4 | SUBDIRS = \ 5 | sslserver \ 6 | sslcppclient 7 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslcppclient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(sslcppclient LANGUAGES CXX) 6 | 7 | if (ANDROID) 8 | message(FATAL_ERROR "This project cannot be built on Android.") 9 | endif() 10 | 11 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 12 | 13 | find_package(Qt6 REQUIRED COMPONENTS Core RemoteObjects) 14 | 15 | qt_standard_project_setup() 16 | 17 | qt_add_executable(sslcppclient 18 | main.cpp 19 | ) 20 | 21 | set_target_properties(sslcppclient PROPERTIES 22 | WIN32_EXECUTABLE TRUE 23 | MACOSX_BUNDLE FALSE 24 | ) 25 | 26 | target_link_libraries(sslcppclient PRIVATE 27 | Qt::Core 28 | Qt::RemoteObjects 29 | ) 30 | 31 | # Resources: 32 | set(cert_resource_files 33 | "../sslserver/cert/client.crt" 34 | "../sslserver/cert/client.key" 35 | "../sslserver/cert/rootCA.key" 36 | "../sslserver/cert/rootCA.pem" 37 | "../sslserver/cert/rootCA.srl" 38 | ) 39 | 40 | qt6_add_resources(sslcppclient "cert" 41 | PREFIX 42 | "/sslcert" 43 | BASE 44 | "../sslserver/cert" 45 | FILES 46 | ${cert_resource_files} 47 | ) 48 | 49 | qt6_add_repc_replicas(sslcppclient 50 | ../../timemodel.rep 51 | ) 52 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslcppclient/sslcppclient.pro: -------------------------------------------------------------------------------- 1 | QT_FOR_CONFIG += network 2 | requires(qtConfig(ssl)) 3 | 4 | REPC_REPLICA += ../../timemodel.rep 5 | QT = remoteobjects remoteobjects-private core 6 | 7 | QT -= gui 8 | 9 | TARGET = sslcppclient 10 | CONFIG -= app_bundle 11 | 12 | TEMPLATE = app 13 | 14 | SOURCES += main.cpp 15 | 16 | RESOURCES += \ 17 | ../sslserver/cert/cert.qrc 18 | 19 | 20 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/ssl/sslcppclient 21 | INSTALLS += target 22 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslserver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(sslserver LANGUAGES CXX) 6 | 7 | if (ANDROID) 8 | message(FATAL_ERROR "This project cannot be built on Android.") 9 | endif() 10 | 11 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 12 | 13 | find_package(Qt6 REQUIRED COMPONENTS Core RemoteObjects) 14 | 15 | qt_standard_project_setup() 16 | 17 | qt_add_executable(sslserver 18 | main.cpp 19 | timemodel.cpp timemodel.h 20 | ) 21 | 22 | set_target_properties(sslserver PROPERTIES 23 | WIN32_EXECUTABLE FALSE 24 | MACOSX_BUNDLE FALSE 25 | ) 26 | 27 | target_link_libraries(sslserver PRIVATE 28 | Qt::Core 29 | Qt::RemoteObjects 30 | ) 31 | 32 | # Resources: 33 | set(cert_resource_files 34 | "cert/rootCA.key" 35 | "cert/rootCA.pem" 36 | "cert/rootCA.srl" 37 | "cert/server.crt" 38 | "cert/server.key" 39 | ) 40 | 41 | qt6_add_resources(sslserver "cert" 42 | PREFIX 43 | "/sslcert" 44 | BASE 45 | "cert" 46 | FILES 47 | ${cert_resource_files} 48 | ) 49 | 50 | qt6_add_repc_sources(sslserver 51 | ../../timemodel.rep 52 | ) 53 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslserver/cert/cert.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | client.crt 4 | client.key 5 | rootCA.key 6 | rootCA.pem 7 | rootCA.srl 8 | server.crt 9 | server.key 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslserver/cert/client.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICrTCCAZUCFHOQggvUf1o8c5i3yNyiGLNcLC4rMA0GCSqGSIb3DQEBCwUAMBIx 3 | EDAOBgNVBAMMB1F0Uk8gQ0EwHhcNMjMwNTMxMDgxMTE1WhcNMjUwOTAyMDgxMTE1 4 | WjAUMRIwEAYDVQQDDAkxMjcuMC4wLjEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw 5 | ggEKAoIBAQDIP/hpIFwU9K1PolZWlgI3k8s8+ZqetECXlL6zf1ZLUWsDhPDeZDLT 6 | xXENiBnEnwomOXesB0G4lcD3r/oWZsEQK3mtukeZEsHRe/bllkqf3LuBcAOt62da 7 | it7On6cBSZNJLL6Hu1ctXi5L/mGoglDu9/2C//zJzj8KKjrDfbxMIuw2/guttYpM 8 | TzPNyrcA0OVaMAcw0niIbZlpJOn1q+sAuDXs1cAYYuNjkj6EUb7WnXJHDKUWu+q7 9 | WoBISfqH0p5bjEFz7VZOKJW25BXbJ6kpHMowBuyvNs+cTfWdRVNfVT+YJz0Vmyvb 10 | cUfFFEzmIIFJs9pH8nmHu6rpAgFfFOyhAgMBAAEwDQYJKoZIhvcNAQELBQADggEB 11 | AF0FzC0gRY0s6rAoJ+WV5WwCLahvUi4hR+Uug09rn1dgccDXMOcsFqGa9IKGaumq 12 | pWL/5aZzwt8izJ2LU3wYPE57bP21wRrVwvdIWX9CKab5DA8kL1BzQsoa+isS/beR 13 | dQjB2L9KZWRDkRVEJcyY/vfBkdJmwHTPBFx/EJjIwA93qfEvuif+bGL7xUVjIgxi 14 | MsSox3BJSdyNQ6MyoumCmUcD+iTCLQsavWpQuUv8nhXoTA2o2ozFSrDvWEuxwZyJ 15 | VRObyZLs1jJPQXAbKkv1DFFdlt3GlbS1TTjnlFMrZ77caDFX/CX01z37qqFTZw88 16 | S3FnpcsSk029XFie37tCYb8= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslserver/cert/readme: -------------------------------------------------------------------------------- 1 | These files are generated by the script located at tests/auto/external_IODevice/cert/generate.sh 2 | 3 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslserver/cert/rootCA.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBTCCAe2gAwIBAgIURtkt3RNfea7kp8Dl9UBvr0mXk0kwDQYJKoZIhvcNAQEL 3 | BQAwEjEQMA4GA1UEAwwHUXRSTyBDQTAeFw0yMzA1MzEwODExMTRaFw0yNTA5MTMw 4 | ODExMTRaMBIxEDAOBgNVBAMMB1F0Uk8gQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB 5 | DwAwggEKAoIBAQDR8adUoBxw9L7E5rkMbvNmY2i5aJUecLSogXZ5arctuBeu4PQC 6 | 2YzZU/0ff/kq8n/NhXATH11D7CXad7pYPbMaP1dqPkBdTAkRjkpwlkhGHQv/9teQ 7 | vMWesVr8rQ4ddk2DK/jmEEyFD3MwTgX8jsw7nhM+mBnhbvK/7DEEoAK6pfDuLl8f 8 | sVAHdc+3RClO0FQAYt1psvPB8Yvqx2NXy3GKRQn+wkr2pVysDkaEEqtgkE2KlD1Q 9 | fyqr5pnN1wDRtkO4syLLlQ9WECRaqU848FFWIH9GkJkx7nmRTEd0Ma/WS0O7BnXG 10 | xD3fRxNKtc7+PVxvdDb/roq2xiq96ww3f4IvAgMBAAGjUzBRMB0GA1UdDgQWBBSP 11 | +7lx7VdfCz4w2UGzgCsb1e69XzAfBgNVHSMEGDAWgBSP+7lx7VdfCz4w2UGzgCsb 12 | 1e69XzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDFBHvmndkO 13 | Up7scewQk8zACOcqyx33kUUT6NiAXDPglzITkVjkNU0r93aek6q5k4WmR2M2nm9n 14 | ptVRWMacZumxkT0wTqDEyH1cWBEjfNBBtI3JwRc2/6JCIEmqnlBc8/YOZ1xSh5/1 15 | T6x8dwNkR43wq1IoWilWIU8/trT97mly3X6yIzITzWEsGIiQmjzWvEJOg8tIjIsV 16 | d7JUDZ+MDC4Rhh/a7v6m7He3dchCsrsIVq/RiJyy8e8mbf0o0slB/SQrxbP0+lQ3 17 | TlE8Wk/FIpAptx0D5qUnq8E6CWxfUv+R6OK/trCQ+ILZgy2ReeM3yX5AZu7brKI3 18 | tHlEN2BVbdEo 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslserver/cert/rootCA.srl: -------------------------------------------------------------------------------- 1 | 7390820BD47F5A3C7398B7C8DCA218B35C2C2E2B 2 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslserver/cert/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDNTCCAh2gAwIBAgIUc5CCC9R/WjxzmLfI3KIYs1wsLiowDQYJKoZIhvcNAQEL 3 | BQAwEjEQMA4GA1UEAwwHUXRSTyBDQTAeFw0yMzA1MzEwODExMTVaFw0yNTA5MDIw 4 | ODExMTVaMBQxEjAQBgNVBAMMCTEyNy4wLjAuMTCCASIwDQYJKoZIhvcNAQEBBQAD 5 | ggEPADCCAQoCggEBAJIhl8T4lEioQYGoIFar95zkXi32PrRQ5cK36fP4mVgbJbmV 6 | ME1y6ZCG/29WMK9Ja3rQn2nkm4RiKVVd4/9WuVM7Eof7w1LRJ5kPxmfUFFc2WSvE 7 | VqazTikBUUYGW0otL0HEgyPBd39lexktJgk9AshGDOrcRZfNGn1SYlqh3g0V+TCz 8 | ZiN1drdIU19ZXWYBpzZcPibHxp0oTpDBIgiAD2TenzuLZkQPTuf+7BVchZ0Gy3nL 9 | VS5E1+M5uKjgaobOTdDLVjrHPgVTH/pa5ZCqELeRFVz6JyioC4HJy2HuZXeZNAQL 10 | zlqMAWNoUAMsvGKJVvg81ps0BmOrNKOaS7WzkZkCAwEAAaOBgDB+MB8GA1UdIwQY 11 | MBaAFI/7uXHtV18LPjDZQbOAKxvV7r1fMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgTw 12 | MBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1UdEQQIMAaHBH8AAAEwHQYDVR0OBBYE 13 | FOTMLTCG7GZ2LY1kn5tI7GTxn4R1MA0GCSqGSIb3DQEBCwUAA4IBAQC46Sr1neC2 14 | g9WikXFnptg6SvrX4xIowxV4f2y2iHSozcBz5lZYLRqLhsl0EuxO9UuCbqPx9nqi 15 | wHBk84S7METP+tmdvDBj7TtLEml7qwQIcR58YLD5Cu3oQLO1jcupq5DFAbKPBTBu 16 | ybJq+osofibogH6qdbYLyTjjFcTkg9A9VHvWEVhfaT355GmR4Yt+RKL9GiapDYF5 17 | ZiB8PRsX1HQzccmZsZrFVWb0klLq1tlDjSK1nx+xDBx7qbDLzUK49ie3k5MTVOfr 18 | E45yOZ6Sh8mHL+gCKcxFk83Wqy8oudChcGEiTEqKxDD268BvB00ECnhF3xAgtM+m 19 | LZ7CbX52p3bW 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslserver/sslserver.pro: -------------------------------------------------------------------------------- 1 | QT_FOR_CONFIG += network 2 | requires(qtConfig(ssl)) 3 | 4 | CONFIG += console 5 | 6 | 7 | REPC_SOURCE += ../../timemodel.rep 8 | QT = remoteobjects remoteobjects-private core 9 | 10 | SOURCES += timemodel.cpp main.cpp 11 | HEADERS += timemodel.h 12 | 13 | contains(QT_CONFIG, c++11): CONFIG += c++11 14 | 15 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/ssl/sslserver 16 | INSTALLS += target 17 | 18 | RESOURCES += \ 19 | cert/cert.qrc 20 | -------------------------------------------------------------------------------- /examples/remoteobjects/ssl/sslserver/timemodel.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include "rep_timemodel_source.h" 6 | 7 | class MinuteTimer : public MinuteTimerSimpleSource 8 | { 9 | Q_OBJECT 10 | public: 11 | MinuteTimer(QObject *parent = nullptr); 12 | ~MinuteTimer() override; 13 | 14 | public slots: 15 | void SetTimeZone(const int &zn) override; 16 | 17 | protected: 18 | void timerEvent(QTimerEvent *) override; 19 | 20 | private: 21 | QTime time; 22 | QBasicTimer timer; 23 | int zone; 24 | }; 25 | -------------------------------------------------------------------------------- /examples/remoteobjects/timemodel.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | POD PresetInfo(int presetNumber, float frequency, QString stationName) 4 | class MinuteTimer 5 | { 6 | PROP(int hour=1); 7 | PROP(int minute=51); 8 | SIGNAL(timeChanged()); 9 | SIGNAL(timeChanged2(QTime t)); 10 | SIGNAL(sendCustom(PresetInfo info)); 11 | SIGNAL(foo(QMap foo)); 12 | SLOT(void SetTimeZone(const int &)); 13 | }; 14 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | if(TARGET Qt::WebSockets AND TARGET Qt::Widgets) 5 | qt_internal_add_example(wsclient) 6 | qt_internal_add_example(wsserver) 7 | endif() 8 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/common/cert/cert.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | client.crt 4 | client.key 5 | rootCA.key 6 | rootCA.pem 7 | rootCA.srl 8 | server.crt 9 | server.key 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/common/cert/client.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICrTCCAZUCFHOQggvUf1o8c5i3yNyiGLNcLC4rMA0GCSqGSIb3DQEBCwUAMBIx 3 | EDAOBgNVBAMMB1F0Uk8gQ0EwHhcNMjMwNTMxMDgxMTE1WhcNMjUwOTAyMDgxMTE1 4 | WjAUMRIwEAYDVQQDDAkxMjcuMC4wLjEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw 5 | ggEKAoIBAQDIP/hpIFwU9K1PolZWlgI3k8s8+ZqetECXlL6zf1ZLUWsDhPDeZDLT 6 | xXENiBnEnwomOXesB0G4lcD3r/oWZsEQK3mtukeZEsHRe/bllkqf3LuBcAOt62da 7 | it7On6cBSZNJLL6Hu1ctXi5L/mGoglDu9/2C//zJzj8KKjrDfbxMIuw2/guttYpM 8 | TzPNyrcA0OVaMAcw0niIbZlpJOn1q+sAuDXs1cAYYuNjkj6EUb7WnXJHDKUWu+q7 9 | WoBISfqH0p5bjEFz7VZOKJW25BXbJ6kpHMowBuyvNs+cTfWdRVNfVT+YJz0Vmyvb 10 | cUfFFEzmIIFJs9pH8nmHu6rpAgFfFOyhAgMBAAEwDQYJKoZIhvcNAQELBQADggEB 11 | AF0FzC0gRY0s6rAoJ+WV5WwCLahvUi4hR+Uug09rn1dgccDXMOcsFqGa9IKGaumq 12 | pWL/5aZzwt8izJ2LU3wYPE57bP21wRrVwvdIWX9CKab5DA8kL1BzQsoa+isS/beR 13 | dQjB2L9KZWRDkRVEJcyY/vfBkdJmwHTPBFx/EJjIwA93qfEvuif+bGL7xUVjIgxi 14 | MsSox3BJSdyNQ6MyoumCmUcD+iTCLQsavWpQuUv8nhXoTA2o2ozFSrDvWEuxwZyJ 15 | VRObyZLs1jJPQXAbKkv1DFFdlt3GlbS1TTjnlFMrZ77caDFX/CX01z37qqFTZw88 16 | S3FnpcsSk029XFie37tCYb8= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/common/cert/readme: -------------------------------------------------------------------------------- 1 | These files are generated by the script located at tests/auto/external_IODevice/cert/generate.sh 2 | 3 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/common/cert/rootCA.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBTCCAe2gAwIBAgIURtkt3RNfea7kp8Dl9UBvr0mXk0kwDQYJKoZIhvcNAQEL 3 | BQAwEjEQMA4GA1UEAwwHUXRSTyBDQTAeFw0yMzA1MzEwODExMTRaFw0yNTA5MTMw 4 | ODExMTRaMBIxEDAOBgNVBAMMB1F0Uk8gQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB 5 | DwAwggEKAoIBAQDR8adUoBxw9L7E5rkMbvNmY2i5aJUecLSogXZ5arctuBeu4PQC 6 | 2YzZU/0ff/kq8n/NhXATH11D7CXad7pYPbMaP1dqPkBdTAkRjkpwlkhGHQv/9teQ 7 | vMWesVr8rQ4ddk2DK/jmEEyFD3MwTgX8jsw7nhM+mBnhbvK/7DEEoAK6pfDuLl8f 8 | sVAHdc+3RClO0FQAYt1psvPB8Yvqx2NXy3GKRQn+wkr2pVysDkaEEqtgkE2KlD1Q 9 | fyqr5pnN1wDRtkO4syLLlQ9WECRaqU848FFWIH9GkJkx7nmRTEd0Ma/WS0O7BnXG 10 | xD3fRxNKtc7+PVxvdDb/roq2xiq96ww3f4IvAgMBAAGjUzBRMB0GA1UdDgQWBBSP 11 | +7lx7VdfCz4w2UGzgCsb1e69XzAfBgNVHSMEGDAWgBSP+7lx7VdfCz4w2UGzgCsb 12 | 1e69XzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDFBHvmndkO 13 | Up7scewQk8zACOcqyx33kUUT6NiAXDPglzITkVjkNU0r93aek6q5k4WmR2M2nm9n 14 | ptVRWMacZumxkT0wTqDEyH1cWBEjfNBBtI3JwRc2/6JCIEmqnlBc8/YOZ1xSh5/1 15 | T6x8dwNkR43wq1IoWilWIU8/trT97mly3X6yIzITzWEsGIiQmjzWvEJOg8tIjIsV 16 | d7JUDZ+MDC4Rhh/a7v6m7He3dchCsrsIVq/RiJyy8e8mbf0o0slB/SQrxbP0+lQ3 17 | TlE8Wk/FIpAptx0D5qUnq8E6CWxfUv+R6OK/trCQ+ILZgy2ReeM3yX5AZu7brKI3 18 | tHlEN2BVbdEo 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/common/cert/rootCA.srl: -------------------------------------------------------------------------------- 1 | 7390820BD47F5A3C7398B7C8DCA218B35C2C2E2B 2 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/common/cert/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDNTCCAh2gAwIBAgIUc5CCC9R/WjxzmLfI3KIYs1wsLiowDQYJKoZIhvcNAQEL 3 | BQAwEjEQMA4GA1UEAwwHUXRSTyBDQTAeFw0yMzA1MzEwODExMTVaFw0yNTA5MDIw 4 | ODExMTVaMBQxEjAQBgNVBAMMCTEyNy4wLjAuMTCCASIwDQYJKoZIhvcNAQEBBQAD 5 | ggEPADCCAQoCggEBAJIhl8T4lEioQYGoIFar95zkXi32PrRQ5cK36fP4mVgbJbmV 6 | ME1y6ZCG/29WMK9Ja3rQn2nkm4RiKVVd4/9WuVM7Eof7w1LRJ5kPxmfUFFc2WSvE 7 | VqazTikBUUYGW0otL0HEgyPBd39lexktJgk9AshGDOrcRZfNGn1SYlqh3g0V+TCz 8 | ZiN1drdIU19ZXWYBpzZcPibHxp0oTpDBIgiAD2TenzuLZkQPTuf+7BVchZ0Gy3nL 9 | VS5E1+M5uKjgaobOTdDLVjrHPgVTH/pa5ZCqELeRFVz6JyioC4HJy2HuZXeZNAQL 10 | zlqMAWNoUAMsvGKJVvg81ps0BmOrNKOaS7WzkZkCAwEAAaOBgDB+MB8GA1UdIwQY 11 | MBaAFI/7uXHtV18LPjDZQbOAKxvV7r1fMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgTw 12 | MBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1UdEQQIMAaHBH8AAAEwHQYDVR0OBBYE 13 | FOTMLTCG7GZ2LY1kn5tI7GTxn4R1MA0GCSqGSIb3DQEBCwUAA4IBAQC46Sr1neC2 14 | g9WikXFnptg6SvrX4xIowxV4f2y2iHSozcBz5lZYLRqLhsl0EuxO9UuCbqPx9nqi 15 | wHBk84S7METP+tmdvDBj7TtLEml7qwQIcR58YLD5Cu3oQLO1jcupq5DFAbKPBTBu 16 | ybJq+osofibogH6qdbYLyTjjFcTkg9A9VHvWEVhfaT355GmR4Yt+RKL9GiapDYF5 17 | ZiB8PRsX1HQzccmZsZrFVWb0klLq1tlDjSK1nx+xDBx7qbDLzUK49ie3k5MTVOfr 18 | E45yOZ6Sh8mHL+gCKcxFk83Wqy8oudChcGEiTEqKxDD268BvB00ECnhF3xAgtM+m 19 | LZ7CbX52p3bW 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/common/common.pri: -------------------------------------------------------------------------------- 1 | CONFIG -= app_bundle 2 | 3 | INCLUDEPATH += $$PWD 4 | 5 | HEADERS += \ 6 | $$PWD/websocketiodevice.h 7 | 8 | SOURCES += \ 9 | $$PWD/websocketiodevice.cpp 10 | 11 | RESOURCES += $$PWD/cert/cert.qrc 12 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/common/websocketiodevice.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef WEBSOCKETIODEVICE_H 5 | #define WEBSOCKETIODEVICE_H 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class WebSocketIoDevice : public QIODevice 13 | { 14 | Q_OBJECT 15 | public: 16 | WebSocketIoDevice(QWebSocket *webSocket, QObject *parent = nullptr); 17 | 18 | signals: 19 | void disconnected(); 20 | 21 | // QIODevice interface 22 | public: 23 | qint64 bytesAvailable() const override; 24 | bool isSequential() const override; 25 | void close() override; 26 | 27 | protected: 28 | qint64 readData(char *data, qint64 maxlen) override; 29 | qint64 writeData(const char *data, qint64 len) override; 30 | 31 | private: 32 | QPointer m_socket; 33 | QByteArray m_buffer; 34 | }; 35 | 36 | #endif // WEBSOCKETIODEVICE_H 37 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/websockets.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | qtHaveModule(widgets): qtHaveModule(websockets) { 4 | SUBDIRS += \ 5 | wsclient \ 6 | wsserver 7 | } 8 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/wsclient/wsclient.pro: -------------------------------------------------------------------------------- 1 | QT += widgets remoteobjects websockets 2 | requires(qtConfig(treeview)) 3 | 4 | SOURCES += main.cpp 5 | 6 | include(../common/common.pri) 7 | 8 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/websockets/wsclient 9 | INSTALLS += target 10 | -------------------------------------------------------------------------------- /examples/remoteobjects/websockets/wsserver/wsserver.pro: -------------------------------------------------------------------------------- 1 | QT += widgets remoteobjects websockets 2 | requires(qtConfig(treeview)) 3 | 4 | SOURCES += main.cpp 5 | 6 | include(../common/common.pri) 7 | 8 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/websockets/wsserver 9 | INSTALLS += target 10 | -------------------------------------------------------------------------------- /mkspecs/features/features.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = aux 2 | 3 | prf.files = remoteobjects_repc.prf repcclient.pri repcserver.pri repcmerged.pri repccommon.pri repparser.prf 4 | prf.path = $$[QT_HOST_DATA]/mkspecs/features 5 | INSTALLS += prf 6 | 7 | # Ensure files are copied to qtbase mkspecs for non-prefixed builds 8 | !force_independent:if(!debug_and_release|!build_all|CONFIG(release, debug|release)) { 9 | defineReplace(stripSrcDir) { 10 | return($$relative_path($$1, $$_PRO_FILE_PWD_)) 11 | } 12 | prffiles2build.input = prf.files 13 | prffiles2build.output = $$[QT_HOST_DATA]/mkspecs/features/${QMAKE_FUNC_FILE_IN_stripSrcDir} 14 | prffiles2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} 15 | prffiles2build.name = COPY ${QMAKE_FILE_IN} 16 | prffiles2build.CONFIG = no_link target_predeps 17 | QMAKE_EXTRA_COMPILERS += prffiles2build 18 | } 19 | -------------------------------------------------------------------------------- /mkspecs/features/remoteobjects_repc.prf: -------------------------------------------------------------------------------- 1 | include(repcclient.pri) 2 | include(repcserver.pri) 3 | include(repcmerged.pri) 4 | 5 | !isEmpty(QOBJECT_REP) { 6 | qtPrepareLibExecTool(QMAKE_REPC, repc) 7 | 8 | for (path, QT.remoteobjects.includes) { 9 | REPC_INCLUDEPATH += -I $$shell_quote($$path) 10 | } 11 | 12 | qtPrepareLibExecTool(MOC_CREATE_JSON, moc) 13 | moc_json.output = ${QMAKE_FILE_BASE}.json 14 | moc_json.CONFIG = no_link moc_verify 15 | moc_json.commands = $$MOC_CREATE_JSON -o ${QMAKE_FILE_BASE} ${QMAKE_FILE_NAME} --output-json 16 | moc_json.depends = ${QMAKE_FILE_NAME} 17 | moc_json.input = QOBJECT_REP 18 | moc_json.variable_out = MOC_JSON 19 | 20 | source2rep.input = MOC_JSON 21 | source2rep.output = ${QMAKE_FILE_BASE}.rep 22 | source2rep.commands = $$QMAKE_REPC $$REPC_INCLUDEPATH -o rep -i json ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT} 23 | source2rep.depends = ${QMAKE_FILE_NAME} $$QT_TOOL.repc.binary 24 | source2rep.CONFIG += target_predeps no_link 25 | QMAKE_EXTRA_COMPILERS += moc_json source2rep 26 | } 27 | -------------------------------------------------------------------------------- /mkspecs/features/repcclient.pri: -------------------------------------------------------------------------------- 1 | repc_type = replica 2 | repc_option = -o replica 3 | 4 | include(repccommon.pri) 5 | -------------------------------------------------------------------------------- /mkspecs/features/repcmerged.pri: -------------------------------------------------------------------------------- 1 | repc_type = merged 2 | repc_option = -o merged 3 | 4 | include(repccommon.pri) 5 | -------------------------------------------------------------------------------- /mkspecs/features/repcserver.pri: -------------------------------------------------------------------------------- 1 | repc_type = source 2 | repc_option = -o source 3 | 4 | include(repccommon.pri) 5 | -------------------------------------------------------------------------------- /mkspecs/features/repparser.prf: -------------------------------------------------------------------------------- 1 | CONFIG += qlalr 2 | INCLUDEPATH *= $$QT.repparser.includes 3 | 4 | for (include, INCLUDEPATH) { 5 | exists($${include}/parser.g) { 6 | msvc: QMAKE_CXXFLAGS += /wd4129 7 | QLALRSOURCES += $${include}/parser.g 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /mkspecs/mkspecs.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += features 4 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(repparser) 6 | if(QT_FEATURE_localserver) 7 | add_subdirectory(remoteobjects) 8 | if(TARGET Qt::Quick) 9 | add_subdirectory(remoteobjectsqml) 10 | endif() 11 | endif() 12 | -------------------------------------------------------------------------------- /src/remoteobjects/Qt5RemoteObjectsConfigExtras.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Ford Motor Company 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | add_executable(Qt5::repc IMPORTED) 4 | 5 | !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) 6 | set(imported_location \"${_qt5RemoteObjects_install_prefix}/$${CMAKE_BIN_DIR}repc$$CMAKE_BIN_SUFFIX\") 7 | !!ELSE 8 | set(imported_location \"$${CMAKE_BIN_DIR}repc$$CMAKE_BIN_SUFFIX\") 9 | !!ENDIF 10 | _qt5_RemoteObjects_check_file_exists(${imported_location}) 11 | 12 | set_target_properties(Qt5::repc PROPERTIES 13 | IMPORTED_LOCATION ${imported_location} 14 | ) 15 | get_target_property(Qt5RemoteObjects_REPC_EXECUTABLE Qt5::repc LOCATION) 16 | endif() 17 | 18 | # Create versionless tool targets. 19 | foreach(__qt_tool repc) 20 | if(NOT \"${QT_NO_CREATE_VERSIONLESS_TARGETS}\" AND NOT TARGET Qt::${__qt_tool} 21 | AND TARGET Qt5::${__qt_tool}) 22 | add_executable(Qt::${__qt_tool} IMPORTED) 23 | get_target_property(__qt_imported_location Qt5::${__qt_tool} IMPORTED_LOCATION) 24 | set_target_properties(Qt::${__qt_tool} 25 | PROPERTIES IMPORTED_LOCATION \"${__qt_imported_location}\") 26 | endif() 27 | endforeach() 28 | -------------------------------------------------------------------------------- /src/remoteobjects/configure.cmake: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | 6 | #### Inputs 7 | 8 | 9 | 10 | #### Libraries 11 | 12 | 13 | 14 | #### Tests 15 | 16 | 17 | 18 | #### Features 19 | 20 | qt_feature("use_ham" PUBLIC 21 | LABEL "High Availability Manager (ham)" 22 | PURPOSE "Use QNX's High Availability Manager (ham) library" 23 | AUTODETECT OFF 24 | CONDITION QNX 25 | ) 26 | qt_feature_definition("use_ham" "QT_NO_USE_HAM" NEGATE VALUE "1") 27 | qt_configure_add_summary_section(NAME "Qt Remote Objects") 28 | qt_configure_add_summary_entry(ARGS "use_ham") 29 | qt_configure_end_summary_section() # end of "Qt Remote Objects" section 30 | -------------------------------------------------------------------------------- /src/remoteobjects/doc/images/DirectConnectClientServerOutput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/src/remoteobjects/doc/images/DirectConnectClientServerOutput.png -------------------------------------------------------------------------------- /src/remoteobjects/doc/images/DirectConnectServerOutput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/src/remoteobjects/doc/images/DirectConnectServerOutput.png -------------------------------------------------------------------------------- /src/remoteobjects/doc/images/README: -------------------------------------------------------------------------------- 1 | Put all documentation images into this folder. 2 | -------------------------------------------------------------------------------- /src/remoteobjects/doc/images/RemoteObjectsHighLevel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/src/remoteobjects/doc/images/RemoteObjectsHighLevel.png -------------------------------------------------------------------------------- /src/remoteobjects/doc/images/StandardItemTableWindow.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/src/remoteobjects/doc/images/StandardItemTableWindow.webp -------------------------------------------------------------------------------- /src/remoteobjects/doc/images/ble_example_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/src/remoteobjects/doc/images/ble_example_flow.png -------------------------------------------------------------------------------- /src/remoteobjects/doc/images/ble_example_iodevice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/src/remoteobjects/doc/images/ble_example_iodevice.png -------------------------------------------------------------------------------- /src/remoteobjects/doc/images/simpleswitch-example.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/src/remoteobjects/doc/images/simpleswitch-example.webp -------------------------------------------------------------------------------- /src/remoteobjects/doc/images/ssl-example.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtremoteobjects/37a489062d2e87e9456eb9759afb7689c8ed56f6/src/remoteobjects/doc/images/ssl-example.webp -------------------------------------------------------------------------------- /src/remoteobjects/doc/snippets/README: -------------------------------------------------------------------------------- 1 | Put all snipplets into this folder. 2 | -------------------------------------------------------------------------------- /src/remoteobjects/doc/snippets/cmake-macros/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include "simpleswitch.h" 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QCoreApplication a(argc, argv); 10 | 11 | SimpleSwitch srcSwitch; // create simple switch 12 | 13 | QRemoteObjectHost srcNode(QUrl(QStringLiteral("local:replica"))); // create host node without Registry 14 | srcNode.enableRemoting(&srcSwitch); // enable remoting/Sharing 15 | 16 | return a.exec(); 17 | } 18 | -------------------------------------------------------------------------------- /src/remoteobjects/doc/snippets/cmake-macros/simpleswitch.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef SIMPLESWITCH_H 5 | #define SIMPLESWITCH_H 6 | 7 | #include "rep_simpleswitch_source.h" 8 | class QTimer; 9 | 10 | class SimpleSwitch : public SimpleSwitchSimpleSource 11 | { 12 | Q_OBJECT 13 | public: 14 | SimpleSwitch(QObject *parent = nullptr); 15 | ~SimpleSwitch() override; 16 | void server_slot(bool clientState) override; 17 | public Q_SLOTS: 18 | void timeout_slot(); 19 | private: 20 | QTimer *stateChangeTimer; 21 | }; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/remoteobjects/doc/snippets/cmake-macros/simpleswitch.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class SimpleSwitch 4 | { 5 | PROP(bool currState=false); 6 | SLOT(void server_slot(bool clientState)); 7 | }; 8 | -------------------------------------------------------------------------------- /src/remoteobjects/doc/snippets/doc_src_remoteobjects.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | //! [qtremoteobject_include] 5 | #include 6 | //! [qtremoteobject_include] 7 | 8 | //! [implementing_source] 9 | #include "rep_TimeModel_source.h" 10 | 11 | class MinuteTimer : public MinuteTimerSource 12 | { 13 | Q_OBJECT 14 | public: 15 | MinuteTimer(QObject *parent = nullptr); 16 | virtual ~MinuteTimer(); 17 | 18 | public slots: 19 | virtual void SetTimeZone(int zn) { //this is a pure virtual method in MinuteTimerSource 20 | qDebug()<<"SetTimeZone"< 8 | #include 9 | 10 | QT_BEGIN_NAMESPACE 11 | 12 | class QQnxNativeServerPrivate; 13 | class QQnxNativeIo; 14 | class QIOQnxSource; 15 | 16 | class Q_REMOTEOBJECTS_EXPORT QQnxNativeServer : public QObject 17 | { 18 | Q_OBJECT 19 | Q_DECLARE_PRIVATE(QQnxNativeServer) 20 | 21 | Q_SIGNALS: 22 | void newConnection(); 23 | 24 | public: 25 | explicit QQnxNativeServer(QObject *parent = nullptr); 26 | ~QQnxNativeServer(); 27 | 28 | void close(); 29 | bool hasPendingConnections() const; 30 | bool isListening() const; 31 | bool listen(const QString &name); 32 | QSharedPointer nextPendingConnection(); 33 | QString serverName() const; 34 | bool waitForNewConnection(int msec = 0, bool *timedOut = nullptr); 35 | 36 | private Q_SLOTS: 37 | void onSourceClosed(); 38 | 39 | private: 40 | Q_DISABLE_COPY(QQnxNativeServer) 41 | friend class QIOQnxSource; 42 | }; 43 | 44 | QT_END_NAMESPACE 45 | 46 | #endif // QQNXNATIVESERVER_H 47 | -------------------------------------------------------------------------------- /src/remoteobjects/qremoteobjectdynamicreplica.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QDYNAMICREMOTEOBJECT_H 5 | #define QDYNAMICREMOTEOBJECT_H 6 | 7 | #include 8 | 9 | QT_BEGIN_NAMESPACE 10 | 11 | class Q_REMOTEOBJECTS_EXPORT QRemoteObjectDynamicReplica : public QRemoteObjectReplica 12 | { 13 | public: 14 | ~QRemoteObjectDynamicReplica() override; 15 | 16 | const QMetaObject *metaObject() const override; 17 | void *qt_metacast(const char *name) override; 18 | int qt_metacall(QMetaObject::Call call, int id, void **argv) override; 19 | 20 | private: 21 | explicit QRemoteObjectDynamicReplica(); 22 | explicit QRemoteObjectDynamicReplica(QRemoteObjectNode *node, const QString &name); 23 | friend class QRemoteObjectNodePrivate; 24 | friend class QRemoteObjectNode; 25 | }; 26 | 27 | QT_END_NAMESPACE 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/remoteobjects/qremoteobjectsettingsstore.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only 3 | 4 | #ifndef QREMOTEOBJECTSETTINGSSTORE_H 5 | #define QREMOTEOBJECTSETTINGSSTORE_H 6 | 7 | #include 8 | 9 | QT_BEGIN_NAMESPACE 10 | 11 | class QRemoteObjectSettingsStorePrivate; 12 | 13 | class Q_REMOTEOBJECTS_EXPORT QRemoteObjectSettingsStore : public QRemoteObjectAbstractPersistedStore 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | QRemoteObjectSettingsStore(QObject *parent = nullptr); 19 | ~QRemoteObjectSettingsStore() override; 20 | 21 | void saveProperties(const QString &repName, const QByteArray &repSig, const QVariantList &values) override; 22 | QVariantList restoreProperties(const QString &repName, const QByteArray &repSig) override; 23 | 24 | private: 25 | Q_DECLARE_PRIVATE(QRemoteObjectSettingsStore) 26 | }; 27 | 28 | QT_END_NAMESPACE 29 | 30 | #endif // QREMOTEOBJECTSETTINGSSTORE_H 31 | -------------------------------------------------------------------------------- /src/remoteobjectsqml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## qtremoteobjects Plugin: 7 | ##################################################################### 8 | 9 | qt_internal_add_qml_module(RemoteObjectsQml 10 | URI "QtRemoteObjects" 11 | VERSION "${PROJECT_VERSION}" 12 | PLUGIN_TARGET declarative_remoteobjects 13 | CLASS_NAME QtRemoteObjectsPlugin 14 | SOURCES 15 | qremoteobjectsqml_p.h 16 | PUBLIC_LIBRARIES 17 | Qt::Core 18 | Qt::Gui 19 | Qt::Qml 20 | Qt::RemoteObjects 21 | NO_GENERATE_CPP_EXPORTS 22 | ) 23 | -------------------------------------------------------------------------------- /src/repparser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## RepParser Module: 7 | ##################################################################### 8 | 9 | qt_internal_add_module(RepParser 10 | HEADER_MODULE 11 | NO_PRIVATE_MODULE 12 | PUBLIC_LIBRARIES 13 | Qt::Core 14 | NO_GENERATE_CPP_EXPORTS 15 | ) 16 | 17 | qt_internal_module_info(module RepParser) 18 | qt_path_join(parser_install_dir "${QT_INSTALL_DIR}" "${INSTALL_INCLUDEDIR}" "${module}") 19 | 20 | qt_copy_or_install( 21 | FILES 22 | "${CMAKE_CURRENT_SOURCE_DIR}/parser.g" 23 | "${CMAKE_CURRENT_SOURCE_DIR}/qregexparser.h" 24 | DESTINATION 25 | "${parser_install_dir}" 26 | ) 27 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS QuickTestUtilsPrivate) 6 | 7 | if(QT_BUILD_STANDALONE_TESTS) 8 | # Add qt_find_package calls for extra dependencies that need to be found when building 9 | # the standalone tests here. 10 | endif() 11 | qt_build_tests() 12 | -------------------------------------------------------------------------------- /tests/auto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(benchmarks) 6 | if(NOT (WIN32 AND CMAKE_CROSSCOMPILING)) 7 | add_subdirectory(cmake) 8 | endif() 9 | add_subdirectory(modelreplica) 10 | add_subdirectory(modelview) 11 | add_subdirectory(pods) 12 | add_subdirectory(proxy) 13 | if(NOT CMAKE_CROSSCOMPILING) 14 | add_subdirectory(rep_from_header) 15 | endif() 16 | add_subdirectory(repc) 17 | add_subdirectory(repcodegenerator) 18 | add_subdirectory(repcinlib) 19 | add_subdirectory(repparser) 20 | add_subdirectory(subclassreplica) 21 | if(QT_FEATURE_ssl) 22 | add_subdirectory(external_IODevice) 23 | endif() 24 | if(TARGET Qt::Qml) 25 | add_subdirectory(qml) 26 | endif() 27 | if(QT_FEATURE_process) 28 | add_subdirectory(integration_multiprocess) 29 | add_subdirectory(proxy_multiprocess) 30 | add_subdirectory(integration_external) 31 | add_subdirectory(restart) 32 | add_subdirectory(reconnect) 33 | endif() 34 | add_subdirectory(localsockettestserver) 35 | add_subdirectory(integration) 36 | add_subdirectory(localserveroption) 37 | -------------------------------------------------------------------------------- /tests/auto/benchmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_benchmarkstest Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_benchmarkstest 10 | SOURCES 11 | tst_benchmarkstest.cpp 12 | DEFINES 13 | SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" 14 | LIBRARIES 15 | Qt::Network 16 | Qt::RemoteObjects 17 | ) 18 | qt6_add_repc_sources(tst_benchmarkstest 19 | ../repfiles/localdatacenter.rep 20 | ../repfiles/tcpdatacenter.rep 21 | ) 22 | qt6_add_repc_replicas(tst_benchmarkstest 23 | ../repfiles/localdatacenter.rep 24 | ../repfiles/tcpdatacenter.rep 25 | ) 26 | -------------------------------------------------------------------------------- /tests/auto/cmake/test_cmake_macros/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | 6 | project(test_qremoteobjects_module) 7 | 8 | find_package(Qt6RemoteObjects REQUIRED) 9 | 10 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 11 | 12 | set(MAIN_SRCS main.cpp) 13 | add_executable(mainapp ${MAIN_SRCS}) 14 | qt6_add_repc_replicas(mainapp ../../integration/pod.rep) 15 | 16 | target_link_libraries(mainapp Qt::RemoteObjects) 17 | -------------------------------------------------------------------------------- /tests/auto/cmake/test_cmake_macros/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | 6 | #include "rep_pod_replica.h" 7 | 8 | int main(int argc, char **argv) 9 | { 10 | QRemoteObjectNode node; 11 | 12 | MyClassReplica replica; 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(sslTestServer) 6 | add_subdirectory(tst_client) 7 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/cert/client.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICrTCCAZUCFHOQggvUf1o8c5i3yNyiGLNcLC4rMA0GCSqGSIb3DQEBCwUAMBIx 3 | EDAOBgNVBAMMB1F0Uk8gQ0EwHhcNMjMwNTMxMDgxMTE1WhcNMjUwOTAyMDgxMTE1 4 | WjAUMRIwEAYDVQQDDAkxMjcuMC4wLjEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw 5 | ggEKAoIBAQDIP/hpIFwU9K1PolZWlgI3k8s8+ZqetECXlL6zf1ZLUWsDhPDeZDLT 6 | xXENiBnEnwomOXesB0G4lcD3r/oWZsEQK3mtukeZEsHRe/bllkqf3LuBcAOt62da 7 | it7On6cBSZNJLL6Hu1ctXi5L/mGoglDu9/2C//zJzj8KKjrDfbxMIuw2/guttYpM 8 | TzPNyrcA0OVaMAcw0niIbZlpJOn1q+sAuDXs1cAYYuNjkj6EUb7WnXJHDKUWu+q7 9 | WoBISfqH0p5bjEFz7VZOKJW25BXbJ6kpHMowBuyvNs+cTfWdRVNfVT+YJz0Vmyvb 10 | cUfFFEzmIIFJs9pH8nmHu6rpAgFfFOyhAgMBAAEwDQYJKoZIhvcNAQELBQADggEB 11 | AF0FzC0gRY0s6rAoJ+WV5WwCLahvUi4hR+Uug09rn1dgccDXMOcsFqGa9IKGaumq 12 | pWL/5aZzwt8izJ2LU3wYPE57bP21wRrVwvdIWX9CKab5DA8kL1BzQsoa+isS/beR 13 | dQjB2L9KZWRDkRVEJcyY/vfBkdJmwHTPBFx/EJjIwA93qfEvuif+bGL7xUVjIgxi 14 | MsSox3BJSdyNQ6MyoumCmUcD+iTCLQsavWpQuUv8nhXoTA2o2ozFSrDvWEuxwZyJ 15 | VRObyZLs1jJPQXAbKkv1DFFdlt3GlbS1TTjnlFMrZ77caDFX/CX01z37qqFTZw88 16 | S3FnpcsSk029XFie37tCYb8= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/cert/rootCA.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBTCCAe2gAwIBAgIURtkt3RNfea7kp8Dl9UBvr0mXk0kwDQYJKoZIhvcNAQEL 3 | BQAwEjEQMA4GA1UEAwwHUXRSTyBDQTAeFw0yMzA1MzEwODExMTRaFw0yNTA5MTMw 4 | ODExMTRaMBIxEDAOBgNVBAMMB1F0Uk8gQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB 5 | DwAwggEKAoIBAQDR8adUoBxw9L7E5rkMbvNmY2i5aJUecLSogXZ5arctuBeu4PQC 6 | 2YzZU/0ff/kq8n/NhXATH11D7CXad7pYPbMaP1dqPkBdTAkRjkpwlkhGHQv/9teQ 7 | vMWesVr8rQ4ddk2DK/jmEEyFD3MwTgX8jsw7nhM+mBnhbvK/7DEEoAK6pfDuLl8f 8 | sVAHdc+3RClO0FQAYt1psvPB8Yvqx2NXy3GKRQn+wkr2pVysDkaEEqtgkE2KlD1Q 9 | fyqr5pnN1wDRtkO4syLLlQ9WECRaqU848FFWIH9GkJkx7nmRTEd0Ma/WS0O7BnXG 10 | xD3fRxNKtc7+PVxvdDb/roq2xiq96ww3f4IvAgMBAAGjUzBRMB0GA1UdDgQWBBSP 11 | +7lx7VdfCz4w2UGzgCsb1e69XzAfBgNVHSMEGDAWgBSP+7lx7VdfCz4w2UGzgCsb 12 | 1e69XzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDFBHvmndkO 13 | Up7scewQk8zACOcqyx33kUUT6NiAXDPglzITkVjkNU0r93aek6q5k4WmR2M2nm9n 14 | ptVRWMacZumxkT0wTqDEyH1cWBEjfNBBtI3JwRc2/6JCIEmqnlBc8/YOZ1xSh5/1 15 | T6x8dwNkR43wq1IoWilWIU8/trT97mly3X6yIzITzWEsGIiQmjzWvEJOg8tIjIsV 16 | d7JUDZ+MDC4Rhh/a7v6m7He3dchCsrsIVq/RiJyy8e8mbf0o0slB/SQrxbP0+lQ3 17 | TlE8Wk/FIpAptx0D5qUnq8E6CWxfUv+R6OK/trCQ+ILZgy2ReeM3yX5AZu7brKI3 18 | tHlEN2BVbdEo 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/cert/rootCA.srl: -------------------------------------------------------------------------------- 1 | 7390820BD47F5A3C7398B7C8DCA218B35C2C2E2B 2 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/cert/server-req.ext: -------------------------------------------------------------------------------- 1 | authorityKeyIdentifier=keyid,issuer 2 | basicConstraints=CA:FALSE 3 | keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment 4 | extendedKeyUsage = serverAuth 5 | subjectAltName = @alt_names 6 | 7 | [alt_names] 8 | IP.1 = 127.0.0.1 9 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/cert/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDNTCCAh2gAwIBAgIUc5CCC9R/WjxzmLfI3KIYs1wsLiowDQYJKoZIhvcNAQEL 3 | BQAwEjEQMA4GA1UEAwwHUXRSTyBDQTAeFw0yMzA1MzEwODExMTVaFw0yNTA5MDIw 4 | ODExMTVaMBQxEjAQBgNVBAMMCTEyNy4wLjAuMTCCASIwDQYJKoZIhvcNAQEBBQAD 5 | ggEPADCCAQoCggEBAJIhl8T4lEioQYGoIFar95zkXi32PrRQ5cK36fP4mVgbJbmV 6 | ME1y6ZCG/29WMK9Ja3rQn2nkm4RiKVVd4/9WuVM7Eof7w1LRJ5kPxmfUFFc2WSvE 7 | VqazTikBUUYGW0otL0HEgyPBd39lexktJgk9AshGDOrcRZfNGn1SYlqh3g0V+TCz 8 | ZiN1drdIU19ZXWYBpzZcPibHxp0oTpDBIgiAD2TenzuLZkQPTuf+7BVchZ0Gy3nL 9 | VS5E1+M5uKjgaobOTdDLVjrHPgVTH/pa5ZCqELeRFVz6JyioC4HJy2HuZXeZNAQL 10 | zlqMAWNoUAMsvGKJVvg81ps0BmOrNKOaS7WzkZkCAwEAAaOBgDB+MB8GA1UdIwQY 11 | MBaAFI/7uXHtV18LPjDZQbOAKxvV7r1fMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgTw 12 | MBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1UdEQQIMAaHBH8AAAEwHQYDVR0OBBYE 13 | FOTMLTCG7GZ2LY1kn5tI7GTxn4R1MA0GCSqGSIb3DQEBCwUAA4IBAQC46Sr1neC2 14 | g9WikXFnptg6SvrX4xIowxV4f2y2iHSozcBz5lZYLRqLhsl0EuxO9UuCbqPx9nqi 15 | wHBk84S7METP+tmdvDBj7TtLEml7qwQIcR58YLD5Cu3oQLO1jcupq5DFAbKPBTBu 16 | ybJq+osofibogH6qdbYLyTjjFcTkg9A9VHvWEVhfaT355GmR4Yt+RKL9GiapDYF5 17 | ZiB8PRsX1HQzccmZsZrFVWb0klLq1tlDjSK1nx+xDBx7qbDLzUK49ie3k5MTVOfr 18 | E45yOZ6Sh8mHL+gCKcxFk83Wqy8oudChcGEiTEqKxDD268BvB00ECnhF3xAgtM+m 19 | LZ7CbX52p3bW 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/pingpong.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class PingPong 4 | { 5 | SLOT(void ping(const QString &message)); 6 | SLOT(void quit()); 7 | SIGNAL(pong(const QString &message)); 8 | }; 9 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/sslTestServer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## sslTestServer Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(sslTestServer 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | pingpong.cpp pingpong.h 14 | sslserver.cpp sslserver.h 15 | INCLUDE_DIRECTORIES 16 | ${CMAKE_CURRENT_SOURCE_DIR} 17 | LIBRARIES 18 | Qt::RemoteObjects 19 | Qt::Test 20 | ) 21 | 22 | # Resources: 23 | set(cert_resource_files 24 | "../cert/client.crt" 25 | "../cert/client.key" 26 | "../cert/rootCA.key" 27 | "../cert/rootCA.pem" 28 | "../cert/rootCA.srl" 29 | "../cert/server.crt" 30 | "../cert/server.key" 31 | ) 32 | 33 | qt_internal_add_resource(sslTestServer "cert" 34 | PREFIX 35 | "/sslcert" 36 | BASE 37 | "../cert" 38 | FILES 39 | ${cert_resource_files} 40 | ) 41 | 42 | qt6_add_repc_sources(sslTestServer 43 | ../pingpong.rep 44 | ) 45 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/sslTestServer/pingpong.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | #include 6 | #include 7 | #include "pingpong.h" 8 | 9 | PingPong::PingPong(QObject *parent) 10 | : PingPongSimpleSource(parent) 11 | {} 12 | 13 | void PingPong::ping(const QString &message) 14 | { 15 | emit pong("Pong " + message); 16 | } 17 | 18 | void PingPong::quit() 19 | { 20 | // Kill me softly 21 | QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection); 22 | } 23 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/sslTestServer/pingpong.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef PINGPONG_H 5 | #define PINGPONG_H 6 | 7 | #include "rep_pingpong_source.h" 8 | 9 | class PingPong : public PingPongSimpleSource 10 | { 11 | public: 12 | PingPong(QObject *parent = nullptr); 13 | 14 | // PingPongSource interface 15 | public slots: 16 | void ping(const QString &message) override; 17 | void quit() override; 18 | }; 19 | 20 | #endif // PINGPONG_H 21 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/sslTestServer/sslserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef SSLSERVER_H 5 | #define SSLSERVER_H 6 | 7 | #include 8 | 9 | QT_BEGIN_NAMESPACE 10 | class QSslSocket; 11 | QT_END_NAMESPACE 12 | 13 | class SslServer : public QTcpServer 14 | { 15 | Q_OBJECT 16 | public: 17 | SslServer(QObject *parent=nullptr); 18 | void incomingConnection(qintptr socketDescriptor) override; 19 | 20 | signals: 21 | void encryptedSocketReady(QSslSocket *socket); 22 | }; 23 | 24 | 25 | #endif // SSLSERVER_H 26 | -------------------------------------------------------------------------------- /tests/auto/external_IODevice/tst_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_external_IODevice Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_external_IODevice 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | tst_client.cpp 13 | LIBRARIES 14 | Qt::RemoteObjects 15 | ) 16 | 17 | # Resources: 18 | set(cert_resource_files 19 | "../cert/client.crt" 20 | "../cert/client.key" 21 | "../cert/rootCA.key" 22 | "../cert/rootCA.pem" 23 | "../cert/rootCA.srl" 24 | "../cert/server.crt" 25 | "../cert/server.key" 26 | ) 27 | 28 | qt_internal_add_resource(tst_external_IODevice "cert" 29 | PREFIX 30 | "/sslcert" 31 | BASE 32 | "../cert" 33 | FILES 34 | ${cert_resource_files} 35 | ) 36 | 37 | qt6_add_repc_replicas(tst_external_IODevice 38 | ../pingpong.rep 39 | ) 40 | -------------------------------------------------------------------------------- /tests/auto/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_integration Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_integration 10 | SOURCES 11 | engine.cpp engine.h 12 | speedometer.cpp speedometer.h 13 | temperature.h 14 | tst_integration.cpp 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | ) 18 | qt6_add_repc_sources(tst_integration 19 | engine.rep 20 | ../repfiles/localdatacenter.rep 21 | ../repfiles/tcpdatacenter.rep 22 | ) 23 | qt6_add_repc_replicas(tst_integration 24 | engine.rep 25 | ../repfiles/localdatacenter.rep 26 | ../repfiles/tcpdatacenter.rep 27 | ) 28 | qt6_add_repc_merged(tst_integration 29 | speedometer.rep 30 | enum.rep 31 | pod.rep 32 | ) 33 | 34 | add_dependencies(tst_integration localsockettestserver) 35 | -------------------------------------------------------------------------------- /tests/auto/integration/engine.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "engine.h" 5 | 6 | Engine::Engine(int cylinders, QObject *parent) : 7 | EngineSimpleSource(cylinders, parent) 8 | { 9 | setRpm(0); 10 | setpurchasedPart(false); 11 | } 12 | 13 | Engine::~Engine() 14 | { 15 | } 16 | 17 | bool Engine::start() 18 | { 19 | if (started()) 20 | return false; // already started 21 | 22 | setStarted(true); 23 | return true; 24 | } 25 | 26 | void Engine::increaseRpm(int deltaRpm) 27 | { 28 | setRpm(rpm() + deltaRpm); 29 | } 30 | 31 | Temperature Engine::temperature() 32 | { 33 | return _temperature; 34 | } 35 | 36 | void Engine::setTemperature(const Temperature &value) 37 | { 38 | _temperature = value; 39 | } 40 | 41 | void Engine::setpurchasedPart(bool value) 42 | { 43 | _purchasedPart = value; 44 | } 45 | -------------------------------------------------------------------------------- /tests/auto/integration/engine.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef TESTS_ENGINE_H 5 | #define TESTS_ENGINE_H 6 | 7 | #include "rep_engine_source.h" 8 | 9 | class Engine : public EngineSimpleSource 10 | { 11 | Q_OBJECT 12 | Q_PROPERTY(bool purchasedPart READ purchasedPart WRITE setpurchasedPart) 13 | 14 | public: 15 | Engine(int cylinders = 4, QObject *parent = nullptr); 16 | ~Engine() override; 17 | 18 | bool start() override; 19 | void increaseRpm(int deltaRpm) override; 20 | 21 | void unnormalizedSignature(int, int) override {} 22 | 23 | Temperature temperature() override; 24 | void setTemperature(const Temperature &value); 25 | 26 | void setSharedTemperature(const Temperature::Ptr &) override {} 27 | 28 | bool purchasedPart() {return _purchasedPart;} 29 | 30 | public Q_SLOTS: 31 | void setpurchasedPart(bool value); 32 | 33 | QString myTestString() override { return _myTestString; } 34 | void setMyTestString(QString value) override { _myTestString = value; } 35 | 36 | private: 37 | bool _purchasedPart; 38 | QString _myTestString; 39 | Temperature _temperature; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /tests/auto/integration/engine.rep: -------------------------------------------------------------------------------- 1 | #include "temperature.h" 2 | 3 | class Engine 4 | { 5 | ENUM EngineType { GAS=0, ELECTRIC=1, HYBRID=2 } 6 | PROP(int cylinders = 4 CONSTANT); 7 | PROP(bool started); 8 | PROP(int rpm READWRITE); 9 | PROP(EngineType engineType=GAS PERSISTED) 10 | 11 | SLOT(bool start()); 12 | SLOT(void increaseRpm(int deltaRpm)); 13 | 14 | SLOT(void unnormalizedSignature(int a, int b)); 15 | 16 | SLOT(Temperature temperature()) 17 | SLOT(void setSharedTemperature(const Temperature::Ptr &sharedTemperature)) 18 | 19 | SLOT(QString myTestString()) 20 | SLOT(setMyTestString(QString value)) 21 | }; 22 | -------------------------------------------------------------------------------- /tests/auto/integration/enum.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestClass 4 | { 5 | ENUM ClassEnum {Null, One, Two} 6 | PROP(TestEnum::Test testEnum) 7 | PROP(ClassEnum classEnum) 8 | PROP(ClassEnum classEnumRW READWRITE) 9 | } 10 | -------------------------------------------------------------------------------- /tests/auto/integration/pod.rep: -------------------------------------------------------------------------------- 1 | POD MyPOD(int i, float f, QString s) 2 | 3 | class MyClass 4 | { 5 | PROP(MyPOD myPOD) 6 | SLOT(QMap myPodMap()) 7 | SLOT(QList myPodList()) 8 | } 9 | -------------------------------------------------------------------------------- /tests/auto/integration/speedometer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "speedometer.h" 5 | 6 | Speedometer::Speedometer(QObject *parent) : 7 | SpeedometerSimpleSource(parent) 8 | { 9 | } 10 | 11 | Speedometer::~Speedometer() 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /tests/auto/integration/speedometer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef TESTS_SPEEDOMETER_H 5 | #define TESTS_SPEEDOMETER_H 6 | 7 | #include "rep_speedometer_merged.h" 8 | 9 | class Speedometer : public SpeedometerSimpleSource 10 | { 11 | Q_OBJECT 12 | public: 13 | Speedometer(QObject *parent = nullptr); 14 | ~Speedometer() override; 15 | 16 | private: 17 | int speed; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /tests/auto/integration/speedometer.rep: -------------------------------------------------------------------------------- 1 | class Speedometer 2 | { 3 | PROP(int mph); 4 | }; 5 | -------------------------------------------------------------------------------- /tests/auto/integration_external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(client) 6 | add_subdirectory(server) 7 | add_subdirectory(external) 8 | -------------------------------------------------------------------------------- /tests/auto/integration_external/MyInterface.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class MyInterface 4 | { 5 | ENUM Enum1 { First, Second, Third } 6 | PROP(Enum1 enum1 = First READWRITE) 7 | 8 | PROP(bool started = false) 9 | 10 | SLOT(bool start()) 11 | SLOT(bool stop()) 12 | SLOT(bool quit()) 13 | SLOT(bool next()) 14 | SLOT(void testEnumParamsInSlots(Enum1 enumSlotParam, bool slotParam2, int)) 15 | 16 | SIGNAL(advance()) 17 | SIGNAL(testEnumParamsInSignals(Enum1 enumSignalParam, bool signalParam2, QString)) 18 | }; 19 | -------------------------------------------------------------------------------- /tests/auto/integration_external/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## integration_external_client Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(integration_external_client 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | INCLUDE_DIRECTORIES 14 | ${CMAKE_CURRENT_SOURCE_DIR} 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(integration_external_client 20 | ../MyInterface.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/integration_external/external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_integration_external Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_integration_external 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | tst_integration_external.cpp 13 | LIBRARIES 14 | Qt::RemoteObjects 15 | ) 16 | -------------------------------------------------------------------------------- /tests/auto/integration_external/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## integration_external_server Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(integration_external_server 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | mytestserver.cpp mytestserver.h 14 | INCLUDE_DIRECTORIES 15 | ${CMAKE_CURRENT_SOURCE_DIR} 16 | LIBRARIES 17 | Qt::RemoteObjects 18 | Qt::Test 19 | ) 20 | qt6_add_repc_sources(integration_external_server 21 | ../MyInterface.rep 22 | ) 23 | -------------------------------------------------------------------------------- /tests/auto/integration_external/server/mytestserver.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | 6 | #include "mytestserver.h" 7 | #include "rep_MyInterface_source.h" 8 | 9 | MyTestServer::MyTestServer(QObject *parent) 10 | : MyInterfaceSimpleSource(parent) 11 | { 12 | qDebug() << "Server started"; 13 | } 14 | 15 | MyTestServer::~MyTestServer() 16 | { 17 | qDebug() << "Server stopped"; 18 | } 19 | 20 | bool MyTestServer::start() 21 | { 22 | setStarted(true); 23 | return true; 24 | } 25 | 26 | bool MyTestServer::stop() 27 | { 28 | setStarted(false); 29 | return true; 30 | } 31 | 32 | bool MyTestServer::quit() 33 | { 34 | emit quitApp(); 35 | return true; 36 | } 37 | 38 | bool MyTestServer::next() 39 | { 40 | emit nextStep(); 41 | return true; 42 | } 43 | 44 | void MyTestServer::testEnumParamsInSlots(Enum1 enumSlotParam, bool slotParam2, int number) 45 | { 46 | setEnum1(enumSlotParam); 47 | setStarted(slotParam2); 48 | emit testEnumParamsInSignals(enum1(), started(), QString::number(number)); 49 | } 50 | -------------------------------------------------------------------------------- /tests/auto/integration_external/server/mytestserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef MYTESTSERVER_H 5 | #define MYTESTSERVER_H 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "rep_MyInterface_source.h" 13 | 14 | class MyTestServer : public MyInterfaceSimpleSource 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | MyTestServer(QObject *parent = nullptr); 20 | ~MyTestServer() override; 21 | 22 | public Q_SLOTS: 23 | bool start() override; 24 | bool stop() override; 25 | bool quit() override; 26 | bool next() override; 27 | void testEnumParamsInSlots(Enum1 enumSlotParam, bool slotParam2, int __repc_variable_1) override; 28 | 29 | Q_SIGNALS: 30 | void quitApp(); 31 | void nextStep(); 32 | }; 33 | 34 | #endif // MYTESTSERVER_H 35 | -------------------------------------------------------------------------------- /tests/auto/integration_multiprocess/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(client) 6 | add_subdirectory(server) 7 | add_subdirectory(tst) 8 | -------------------------------------------------------------------------------- /tests/auto/integration_multiprocess/ExtPodInterface.rep: -------------------------------------------------------------------------------- 1 | POD ExtPOD(int i, float f, QString s) 2 | -------------------------------------------------------------------------------- /tests/auto/integration_multiprocess/MyInterface.rep: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rep_ExtPodInterface_merged.h" 3 | 4 | class MyInterface 5 | { 6 | ENUM Enum1 { First, Second, Third } 7 | PROP(Enum1 enum1 = First READWRITE) 8 | 9 | PROP(bool started = false) 10 | PROP(int initialValue) 11 | 12 | SLOT(bool start()) 13 | SLOT(bool stop()) 14 | SLOT(bool quit()) 15 | SLOT(void testEnumParamsInSlots(Enum1 enumSlotParam, bool slotParam2, int)) 16 | 17 | SIGNAL(advance()) 18 | SIGNAL(testEnumParamsInSignals(Enum1 enumSignalParam, bool signalParam2, QString)) 19 | 20 | SLOT(void testExtPODListSlot(const QList &)) 21 | SIGNAL(testExtPODListSignal(const QList &)) 22 | }; 23 | -------------------------------------------------------------------------------- /tests/auto/integration_multiprocess/PodInterface.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | POD MyPOD(int i, float f, QString s) 4 | 5 | class PodInterface 6 | { 7 | PROP(MyPOD myPod) 8 | }; 9 | -------------------------------------------------------------------------------- /tests/auto/integration_multiprocess/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## integration_multiprocess_client Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(integration_multiprocess_client 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | INCLUDE_DIRECTORIES 14 | ${CMAKE_CURRENT_SOURCE_DIR} 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | 20 | qt6_add_repc_merged(integration_multiprocess_client 21 | ../ExtPodInterface.rep 22 | ) 23 | 24 | qt6_add_repc_replicas(integration_multiprocess_client 25 | ../MyInterface.rep 26 | ) 27 | -------------------------------------------------------------------------------- /tests/auto/integration_multiprocess/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## integration_multiprocess_server Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(integration_multiprocess_server 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | mytestserver.cpp mytestserver.h 14 | INCLUDE_DIRECTORIES 15 | ${CMAKE_CURRENT_SOURCE_DIR} 16 | LIBRARIES 17 | Qt::RemoteObjects 18 | Qt::Test 19 | ) 20 | qt6_add_repc_merged(integration_multiprocess_server 21 | ../ExtPodInterface.rep 22 | ) 23 | 24 | qt6_add_repc_sources(integration_multiprocess_server 25 | ../MyInterface.rep 26 | ../PodInterface.rep 27 | ) 28 | -------------------------------------------------------------------------------- /tests/auto/integration_multiprocess/server/mytestserver.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | 6 | #include "mytestserver.h" 7 | #include "rep_MyInterface_source.h" 8 | 9 | MyTestServer::MyTestServer(QObject *parent) 10 | : MyInterfaceSimpleSource(parent) 11 | { 12 | qDebug() << "Server started"; 13 | setInitialValue(18); 14 | } 15 | 16 | MyTestServer::~MyTestServer() 17 | { 18 | qDebug() << "Server stopped"; 19 | } 20 | 21 | bool MyTestServer::start() 22 | { 23 | setStarted(true); 24 | return true; 25 | } 26 | 27 | bool MyTestServer::stop() 28 | { 29 | setStarted(false); 30 | return true; 31 | } 32 | 33 | bool MyTestServer::quit() 34 | { 35 | emit quitApp(); 36 | return true; 37 | } 38 | 39 | void MyTestServer::testEnumParamsInSlots(Enum1 enumSlotParam, bool slotParam2, int number) 40 | { 41 | setEnum1(enumSlotParam); 42 | setStarted(slotParam2); 43 | emit testEnumParamsInSignals(enum1(), started(), QString::number(number)); 44 | } 45 | 46 | void MyTestServer::testExtPODListSlot(const QList &l) 47 | { 48 | emit testExtPODListSignal(l); 49 | } 50 | -------------------------------------------------------------------------------- /tests/auto/integration_multiprocess/server/mytestserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef MYTESTSERVER_H 5 | #define MYTESTSERVER_H 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "rep_MyInterface_source.h" 13 | 14 | class MyTestServer : public MyInterfaceSimpleSource 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | MyTestServer(QObject *parent = nullptr); 20 | ~MyTestServer() override; 21 | 22 | public Q_SLOTS: 23 | bool start() override; 24 | bool stop() override; 25 | bool quit() override; 26 | void testEnumParamsInSlots(Enum1 enumSlotParam, bool slotParam2, int __repc_variable_1) override; 27 | void testExtPODListSlot(const QList &l) override; 28 | 29 | Q_SIGNALS: 30 | void quitApp(); 31 | }; 32 | 33 | #endif // MYTESTSERVER_H 34 | -------------------------------------------------------------------------------- /tests/auto/integration_multiprocess/tst/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_integration_multiprocess Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_integration_multiprocess 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | tst_integration_multiprocess.cpp 13 | LIBRARIES 14 | Qt::RemoteObjects 15 | ) 16 | -------------------------------------------------------------------------------- /tests/auto/localserveroption/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## tst_localserveroption Test: 6 | ##################################################################### 7 | 8 | qt_internal_add_test(tst_localserveroption 9 | SOURCES 10 | tst_localserveroption.cpp 11 | LIBRARIES 12 | Qt::RemoteObjects 13 | Qt::Core 14 | ) 15 | -------------------------------------------------------------------------------- /tests/auto/localsockettestserver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## localsockettestserver Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(localsockettestserver 10 | SOURCES 11 | main.cpp 12 | LIBRARIES 13 | Qt::RemoteObjects 14 | OUTPUT_DIRECTORY 15 | ${CMAKE_CURRENT_BINARY_DIR} 16 | ) 17 | -------------------------------------------------------------------------------- /tests/auto/localsockettestserver/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | #include 6 | 7 | #include "../../shared/testutils.h" 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | QCoreApplication a(argc, argv); 12 | QObject remotedObject; 13 | remotedObject.setObjectName(QStringLiteral("connectme")); 14 | QRemoteObjectHost node(QUrl(QStringLiteral(LOCAL_SOCKET ":crashMe"))); 15 | node.enableRemoting(&remotedObject); 16 | 17 | return a.exec(); 18 | } 19 | -------------------------------------------------------------------------------- /tests/auto/modelreplica/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_modelreplicatest Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_modelreplicatest 10 | SOURCES 11 | tst_modelreplicatest.cpp 12 | DEFINES 13 | SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" 14 | LIBRARIES 15 | Qt::RemoteObjects 16 | ) 17 | qt6_add_repc_merged(tst_modelreplicatest 18 | model.rep 19 | ) 20 | -------------------------------------------------------------------------------- /tests/auto/modelreplica/model.rep: -------------------------------------------------------------------------------- 1 | class Media 2 | { 3 | ENUM state{Stopped, Paused, Playing} 4 | PROP(QString currentTrack) 5 | PROP(state playState) 6 | MODEL tracks(display) 7 | } 8 | 9 | class OtherMedia 10 | { 11 | MODEL tracks(display,decoration) 12 | } 13 | -------------------------------------------------------------------------------- /tests/auto/modelview/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_modelview Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_modelview 10 | SOURCES 11 | tst_modelview.cpp 12 | ../shared/model_utilities.h 13 | LIBRARIES 14 | Qt::Gui 15 | Qt::RemoteObjects 16 | ) 17 | 18 | ## Scopes: 19 | ##################################################################### 20 | 21 | qt_internal_extend_target(tst_modelview CONDITION boot2qt 22 | DEFINES 23 | SLOW_MODELTEST 24 | ) 25 | 26 | qt_internal_extend_target(tst_modelview CONDITION MINGW 27 | DEFINES 28 | SLOW_MODELTEST 29 | ) 30 | -------------------------------------------------------------------------------- /tests/auto/pods/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_pods Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_pods 10 | SOURCES 11 | tst_pods.cpp 12 | LIBRARIES 13 | Qt::RemoteObjects 14 | ) 15 | qt6_add_repc_replicas(tst_pods 16 | pods.h 17 | ) 18 | 19 | ## Scopes: 20 | ##################################################################### 21 | -------------------------------------------------------------------------------- /tests/auto/pods/tst_pods.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "rep_pods_replica.h" 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | class tst_pods : public QObject { 12 | Q_OBJECT 13 | 14 | private Q_SLOTS: 15 | void testConstructors(); 16 | void testMarshalling(); 17 | }; 18 | 19 | 20 | void tst_pods::testConstructors() 21 | { 22 | PodI pi1; 23 | QCOMPARE(pi1.i(), 0); 24 | 25 | PodI pi2(1); 26 | QCOMPARE(pi2.i(), 1); 27 | 28 | PodI pi3(pi2); 29 | QCOMPARE(pi3.i(), pi2.i()); 30 | } 31 | 32 | void tst_pods::testMarshalling() 33 | { 34 | QByteArray ba; 35 | QDataStream ds(&ba, QIODevice::ReadWrite); 36 | 37 | { 38 | PodI i1(1), i2(2), i3(3), iDeadBeef(0xdeadbeef); 39 | ds << i1 << i2 << i3 << iDeadBeef; 40 | } 41 | 42 | ds.device()->seek(0); 43 | 44 | { 45 | PodI i1, i2, i3, iDeadBeef; 46 | ds >> i1 >> i2 >> i3 >> iDeadBeef; 47 | 48 | QCOMPARE(i1.i(), 1); 49 | QCOMPARE(i2.i(), 2); 50 | QCOMPARE(i3.i(), 3); 51 | QCOMPARE(iDeadBeef.i(), int(0xdeadbeef)); 52 | } 53 | } 54 | 55 | QTEST_APPLESS_MAIN(tst_pods) 56 | 57 | #include "tst_pods.moc" 58 | 59 | -------------------------------------------------------------------------------- /tests/auto/proxy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_proxy Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_proxy 10 | SOURCES 11 | tst_proxy.cpp 12 | ../shared/model_utilities.h 13 | LIBRARIES 14 | Qt::RemoteObjects 15 | ) 16 | qt6_add_repc_merged(tst_proxy 17 | engine.rep 18 | subclass.rep 19 | ) 20 | 21 | ## Scopes: 22 | ##################################################################### 23 | -------------------------------------------------------------------------------- /tests/auto/proxy/engine.rep: -------------------------------------------------------------------------------- 1 | class Engine 2 | { 3 | ENUM EngineType {Null, Gas, Electric, Hybrid}; 4 | PROP(int cylinders = 4) 5 | PROP(bool started) 6 | PROP(int rpm) 7 | PROP(EngineType type) 8 | } 9 | -------------------------------------------------------------------------------- /tests/auto/proxy/subclass.rep: -------------------------------------------------------------------------------- 1 | POD MyPOD(int i, float f, QString s) 2 | 3 | class SubClass 4 | { 5 | PROP(MyPOD myPOD) 6 | } 7 | 8 | class ParentClass 9 | { 10 | CLASS subClass(SubClass) 11 | MODEL tracks(display) 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(client) 6 | add_subdirectory(server) 7 | add_subdirectory(proxy) 8 | add_subdirectory(tst) 9 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## proxy_multiprocess_client Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(proxy_multiprocess_client 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../namespace.h 13 | ../shared.h 14 | main.cpp 15 | INCLUDE_DIRECTORIES 16 | ${CMAKE_CURRENT_SOURCE_DIR} 17 | LIBRARIES 18 | Qt::RemoteObjects 19 | Qt::Test 20 | ) 21 | qt6_add_repc_replicas(proxy_multiprocess_client 22 | ../subclass.rep 23 | ) 24 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef __PROXY_MULTIPROCESS_NAMESPACE_H__ 2 | #define __PROXY_MULTIPROCESS_NAMESPACE_H__ 3 | 4 | #include 5 | 6 | namespace NS 7 | { 8 | Q_NAMESPACE 9 | enum NamespaceEnum { Alpha=1, Bravo, Charlie }; 10 | Q_ENUM_NS(NamespaceEnum) 11 | } 12 | 13 | namespace NS2 14 | { 15 | Q_NAMESPACE 16 | enum class NamespaceEnum : quint8 { Alpha=1, Bravo, Charlie }; 17 | Q_ENUM_NS(NamespaceEnum) 18 | } 19 | 20 | #endif // include guard 21 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/proxy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## proxy Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(proxy 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | INCLUDE_DIRECTORIES 14 | ${CMAKE_CURRENT_SOURCE_DIR} 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/proxy/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "../../../shared/testutils.h" 9 | 10 | class tst_Proxy_Process : public QObject 11 | { 12 | Q_OBJECT 13 | 14 | private Q_SLOTS: 15 | void testRun() 16 | { 17 | m_hostNode.reset(new QRemoteObjectHost); 18 | m_hostNode->setHostUrl(QUrl(QStringLiteral("tcp://127.0.0.1:65213"))); 19 | m_hostNode->proxy(QUrl(LOCAL_SOCKET ":testRegistry")); 20 | 21 | // our proxied object should be added, and then later removed when the server shuts down 22 | QSignalSpy addSpy(m_hostNode.data(), &QRemoteObjectNode::remoteObjectAdded); 23 | QSignalSpy removeSpy(m_hostNode.data(), &QRemoteObjectNode::remoteObjectRemoved); 24 | QVERIFY(addSpy.wait()); 25 | QVERIFY(removeSpy.wait()); 26 | } 27 | 28 | private: 29 | QScopedPointer m_hostNode; 30 | }; 31 | 32 | QTEST_MAIN(tst_Proxy_Process) 33 | 34 | #include "main.moc" 35 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## proxy_multiprocess_server Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(proxy_multiprocess_server 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ${CMAKE_CURRENT_BINARY_DIR}/rep_subclass_source.h 13 | ../namespace.h 14 | ../shared.h 15 | main.cpp 16 | mytestserver.cpp mytestserver.h 17 | INCLUDE_DIRECTORIES 18 | ${CMAKE_CURRENT_SOURCE_DIR} 19 | LIBRARIES 20 | Qt::RemoteObjects 21 | Qt::Test 22 | ) 23 | qt6_add_repc_sources(proxy_multiprocess_server 24 | ../subclass.rep 25 | ) 26 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/server/mytestserver.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | 6 | #include "mytestserver.h" 7 | 8 | MyTestServer::MyTestServer(QObject *parent) 9 | : ParentClassSimpleSource(parent) 10 | { 11 | qDebug() << "Server started"; 12 | } 13 | 14 | MyTestServer::~MyTestServer() 15 | { 16 | qDebug() << "Server stopped"; 17 | } 18 | 19 | bool MyTestServer::start() 20 | { 21 | setStarted(true); 22 | return true; 23 | } 24 | 25 | bool MyTestServer::quit() 26 | { 27 | emit quitApp(); 28 | return true; 29 | } 30 | 31 | ParentClassSource::MyEnum MyTestServer::enumSlot(QPoint p, MyEnum myEnum) 32 | { 33 | Q_UNUSED(p) 34 | Q_UNUSED(myEnum) 35 | return ParentClassSource::foobar; 36 | } 37 | 38 | Qt::DateFormat MyTestServer::dateSlot(Qt::DateFormat date) 39 | { 40 | Q_UNUSED(date) 41 | return Qt::RFC2822Date; 42 | } 43 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/server/mytestserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef MYTESTSERVER_H 5 | #define MYTESTSERVER_H 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "rep_subclass_source.h" 13 | 14 | class MyTestServer : public ParentClassSimpleSource 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | MyTestServer(QObject *parent = nullptr); 20 | ~MyTestServer() override; 21 | 22 | public Q_SLOTS: 23 | bool start() override; 24 | bool quit() override; 25 | MyEnum enumSlot(QPoint p, MyEnum myEnum) override; 26 | Qt::DateFormat dateSlot(Qt::DateFormat date) override; 27 | 28 | Q_SIGNALS: 29 | void quitApp(); 30 | }; 31 | 32 | #endif // MYTESTSERVER_H 33 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/shared.h: -------------------------------------------------------------------------------- 1 | const MyPOD initialValue(MyPOD::Position::position1, 3.14, QStringLiteral("SubClass")); 2 | const MyPOD updatedValue(MyPOD::Position::position2 | MyPOD::Position::position3, 123.456, QStringLiteral("Updated")); 3 | const VariantPOD podValue(10, 11); 4 | const int initialI = 100; 5 | const int updatedI = 200; 6 | 7 | -------------------------------------------------------------------------------- /tests/auto/proxy_multiprocess/tst/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_proxy_multiprocess Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_proxy_multiprocess 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | tst_proxy_multiprocess.cpp 13 | LIBRARIES 14 | Qt::RemoteObjects 15 | ) 16 | -------------------------------------------------------------------------------- /tests/auto/qml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(integration) 6 | add_subdirectory(usertypes) 7 | -------------------------------------------------------------------------------- /tests/auto/qml/integration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_qmlintegration Test: 7 | ##################################################################### 8 | 9 | # Collect test data 10 | file(GLOB_RECURSE test_data_glob 11 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 12 | ${CMAKE_CURRENT_SOURCE_DIR}/data/tst_*) 13 | list(APPEND test_data ${test_data_glob}) 14 | 15 | qt_internal_add_test(tst_qmlintegration 16 | GUI 17 | QMLTEST 18 | SOURCES 19 | tst_integration.cpp 20 | LIBRARIES 21 | Qt::Gui 22 | TESTDATA ${test_data} 23 | ) 24 | -------------------------------------------------------------------------------- /tests/auto/qml/integration/data/tst_integration.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtTest 1.1 5 | import QtRemoteObjects 5.12 6 | 7 | TestCase { 8 | id: testCase 9 | 10 | Node { 11 | id: defaultNode 12 | } 13 | 14 | Node { 15 | id: nodeWithPersistedStore 16 | 17 | persistedStore: SettingsStore {} 18 | } 19 | 20 | name: "testIntegration" 21 | function test_integration() 22 | { 23 | // test defaultNode 24 | compare(defaultNode.registryUrl, "") 25 | compare(defaultNode.persistedStore, null) 26 | 27 | // test nodeWithPersistedStore 28 | compare(nodeWithPersistedStore.registryUrl, "") 29 | verify(nodeWithPersistedStore.persistedStore) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/auto/qml/integration/tst_integration.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | QUICK_TEST_MAIN(tst_integration) 6 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_usertypes Test: 7 | ##################################################################### 8 | file(GLOB_RECURSE test_data_glob 9 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 10 | ${CMAKE_CURRENT_SOURCE_DIR}/data/*) 11 | list(APPEND test_data ${test_data_glob}) 12 | 13 | qt_internal_add_test(tst_usertypes 14 | SOURCES 15 | tst_usertypes.cpp 16 | LIBRARIES 17 | Qt::Gui 18 | Qt::Qml 19 | Qt::RemoteObjects 20 | Qt::QuickTestUtilsPrivate 21 | TESTDATA ${test_data} 22 | ) 23 | qt6_add_repc_merged(tst_usertypes 24 | usertypes.rep 25 | ) 26 | 27 | qt_internal_extend_target(tst_usertypes CONDITION ANDROID OR IOS 28 | DEFINES 29 | QT_QMLTEST_DATADIR=":/data" 30 | ) 31 | 32 | qt_internal_extend_target(tst_usertypes CONDITION NOT ANDROID AND NOT IOS 33 | DEFINES 34 | QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data" 35 | ) 36 | 37 | if(QT_BUILD_STANDALONE_TESTS) 38 | # For fully static builds, let qmlimportscanner take care of plugin importing 39 | qt_import_qml_plugins(tst_usertypes) 40 | endif() 41 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/MyType.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | QtObject { 4 | property int value: 39 5 | } 6 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/complex.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtRemoteObjects 5.12 3 | import usertypes 1.0 4 | 5 | ComplexTypeReplica { 6 | node: Node { 7 | property string local_socket: Qt.platform.os == "android" ? "localabstract" : "local" 8 | registryUrl: local_socket + ":testModel" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/composite.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "../data" as MyComponents //for staric build resource path should be set 3 | 4 | QtObject { 5 | property QtObject myTypeOk: MyComponents.MyType {} // this works 6 | property MyComponents.MyType myType: MyComponents.MyType {} // this crashes 7 | property MyComponents.MyType myType2 // this crashes (ensure solution works with null object) 8 | } 9 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/extraPropComplex.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtRemoteObjects 5.12 3 | import usertypes 1.0 4 | 5 | ComplexTypeReplica { 6 | // test that the existence of this property doesn't cause issues 7 | property QtObject object: QtObject {} 8 | 9 | node: Node { 10 | property string local_socket: Qt.platform.os == "android" ? "localabstract" : "local" 11 | registryUrl: local_socket + ":testExtraComplex" 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/extraprop.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtRemoteObjects 5.12 3 | import usertypes 1.0 4 | 5 | SimpleClockReplica { 6 | property string result: hour // test that the existence of this property doesn't cause issues 7 | node: Node { 8 | property string local_socket: Qt.platform.os == "android" ? "localabstract" : "local" 9 | registryUrl: local_socket + ":test" 10 | } 11 | onStateChanged: if (state == SimpleClockReplica.Valid) pushHour(10) 12 | } 13 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/extraprop2.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtRemoteObjects 5.12 3 | import usertypes 1.0 4 | 5 | SimpleClockReplica { 6 | property string result: hour // test that the existence of this property doesn't cause issues 7 | 8 | node: Node { 9 | property string local_socket: Qt.platform.os == "android" ? "localabstract" : "local" 10 | registryUrl: local_socket + ":test2" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/hosted.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtRemoteObjects 5.15 3 | import usertypes 1.0 4 | 5 | Item { 6 | SimpleClockSimpleSource { 7 | id: clock 8 | } 9 | 10 | Host { 11 | property string local_socket: Qt.platform.os == "android" ? "localabstract" : "local" 12 | hostUrl: local_socket + ":testHost" 13 | Component.onCompleted: enableRemoting(clock) 14 | } 15 | 16 | Timer { 17 | interval: 500 18 | running: true 19 | onTriggered: clock.timeUpdated(10, 30) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/model.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtRemoteObjects 5.12 3 | import usertypes 1.0 4 | 5 | TypeWithModelReplica { 6 | node: Node { 7 | property string local_socket: Qt.platform.os == "android" ? "localabstract" : "local" 8 | registryUrl: local_socket + ":testModel" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/subObject.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtRemoteObjects 5.12 3 | import usertypes 1.0 4 | 5 | Item { 6 | property int result: replica.clock.hour 7 | 8 | property Node sharedNode: Node { 9 | property string local_socket: Qt.platform.os == "android" ? "localabstract" : "local" 10 | registryUrl: local_socket + ":testSubObject" 11 | } 12 | 13 | property TypeWithSubObjectReplica replica: TypeWithSubObjectReplica { 14 | node: sharedNode 15 | onStateChanged: if (state == TypeWithSubObjectReplica.Valid) clock.pushHour(7) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/data/twoReplicas.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtRemoteObjects 5.12 3 | import usertypes 1.0 4 | 5 | Item { 6 | property int result: replica.hour 7 | property int result2: replica2.hour 8 | 9 | Node { 10 | id: sharedNode 11 | property string local_socket: Qt.platform.os == "android" ? "localabstract" : "local" 12 | registryUrl: local_socket + ":testTwoReplicas" 13 | } 14 | 15 | SimpleClockReplica { 16 | id: replica 17 | node: sharedNode 18 | } 19 | 20 | SimpleClockReplica { 21 | id: replica2 22 | } 23 | 24 | Timer { 25 | running: true 26 | interval: 200 27 | onTriggered: replica2.node = sharedNode 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /tests/auto/qml/usertypes/usertypes.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class SimpleClock 4 | { 5 | PROP(int hour=6); 6 | PROP(int minute=30); 7 | SIGNAL(timeUpdated(int hour, int minute, int second=0, int millisecond=0)); 8 | }; 9 | 10 | class TypeWithModel 11 | { 12 | MODEL tracks(display); 13 | }; 14 | 15 | class TypeWithSubObject 16 | { 17 | CLASS clock(SimpleClock); 18 | }; 19 | 20 | class ComplexType 21 | { 22 | PROP(int before = 0) 23 | MODEL tracks(display) 24 | CLASS clock(SimpleClock) 25 | PROP(int after = 42) 26 | } 27 | 28 | class TypeWithReply 29 | { 30 | SLOT(QString uppercase(const QString &input)) 31 | SLOT(QMap complexReturnType()) 32 | SLOT(int slowFunction()) 33 | }; 34 | -------------------------------------------------------------------------------- /tests/auto/reconnect/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(client) 6 | add_subdirectory(server) 7 | add_subdirectory(tst) 8 | -------------------------------------------------------------------------------- /tests/auto/reconnect/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | qt_internal_add_executable(qtro_reconnect_client 5 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 6 | SOURCES main.cpp 7 | INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} 8 | LIBRARIES Qt::RemoteObjects Qt::Test 9 | ) 10 | -------------------------------------------------------------------------------- /tests/auto/reconnect/client/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class tst_Client_Process : public QObject 9 | { 10 | Q_OBJECT 11 | 12 | private Q_SLOTS: 13 | void testRun() 14 | { 15 | const QString url = qEnvironmentVariable("RO_URL"); 16 | QRemoteObjectNode node; 17 | node.connectToNode(QUrl(url)); 18 | QRemoteObjectDynamicReplica *ro = node.acquireDynamic("SourceObj"); 19 | 20 | QSignalSpy initSpy(ro, &QRemoteObjectDynamicReplica::initialized); 21 | QVERIFY(initSpy.wait()); 22 | QSignalSpy pongSpy(ro, SIGNAL(pong())); 23 | QMetaObject::invokeMethod(ro, "ping"); 24 | QVERIFY(pongSpy.wait()); 25 | QMetaObject::invokeMethod(ro, "ping"); 26 | 27 | QVERIFY(initSpy.wait()); 28 | QMetaObject::invokeMethod(ro, "ping"); 29 | QVERIFY(pongSpy.wait()); 30 | QMetaObject::invokeMethod(ro, "ping"); 31 | QTest::qWait(100); 32 | delete ro; 33 | } 34 | }; 35 | 36 | QTEST_MAIN(tst_Client_Process) 37 | 38 | #include "main.moc" 39 | -------------------------------------------------------------------------------- /tests/auto/reconnect/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | qt_internal_add_executable(qtro_reconnect_server 5 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 6 | SOURCES main.cpp 7 | INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} 8 | LIBRARIES Qt::RemoteObjects Qt::Test 9 | ) 10 | -------------------------------------------------------------------------------- /tests/auto/reconnect/tst/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | qt_internal_add_test(tst_ro_reconnect 5 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 6 | SOURCES tst_reconnect.cpp 7 | LIBRARIES Qt::RemoteObjects 8 | ) 9 | -------------------------------------------------------------------------------- /tests/auto/rep_from_header/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_rep_from_header Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_rep_from_header 10 | SOURCES 11 | tst_rep_from_header.cpp 12 | LIBRARIES 13 | Qt::RemoteObjects 14 | ) 15 | qt6_reps_from_headers(tst_rep_from_header pods.h) 16 | -------------------------------------------------------------------------------- /tests/auto/repc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(enums) 6 | add_subdirectory(pods) 7 | if(NOT windows) 8 | add_subdirectory(signature) 9 | endif() 10 | -------------------------------------------------------------------------------- /tests/auto/repc/enums/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_enums Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_enums 10 | SOURCES 11 | tst_enums.cpp 12 | LIBRARIES 13 | Qt::RemoteObjects 14 | ) 15 | qt6_add_repc_replicas(tst_enums 16 | enums.rep 17 | ) 18 | 19 | ## Scopes: 20 | ##################################################################### 21 | -------------------------------------------------------------------------------- /tests/auto/repc/enums/enums.rep: -------------------------------------------------------------------------------- 1 | 2 | USE_ENUM(Qt::DayOfWeek) 3 | 4 | class TestInterface 5 | { 6 | }; 7 | 8 | // This needs to generate properly and compile: 9 | ENUM XENUMx {Foo, Bar}; 10 | POD Mode(XENUMxEnum::XENUMx foo); 11 | ENUM ENUM_ {Foo, Bar}; 12 | POD Mode2(ENUM_Enum::ENUM_ foo); 13 | -------------------------------------------------------------------------------- /tests/auto/repc/pods/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_repc_pods Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_repc_pods 10 | SOURCES 11 | tst_pods.cpp 12 | LIBRARIES 13 | Qt::RemoteObjects 14 | ) 15 | qt6_add_repc_replicas(tst_repc_pods 16 | pods.rep 17 | ) 18 | 19 | ## Scopes: 20 | ##################################################################### 21 | -------------------------------------------------------------------------------- /tests/auto/repc/pods/pods.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | ENUM Test {TRUE, FALSE} 4 | 5 | POD PodI(int i) 6 | POD PodF(float f) 7 | POD PodS(QString s) 8 | POD PodIFS(int i, float f, QString s) 9 | POD PodT(QList t) 10 | 11 | class Container { 12 | }; 13 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(signatureServer) 6 | add_subdirectory(matchAndQuit) 7 | add_subdirectory(differentGlobalEnum) 8 | add_subdirectory(differentClassEnum) 9 | add_subdirectory(differentPropertyCount) 10 | add_subdirectory(differentPropertyCountChild) 11 | add_subdirectory(differentPropertyType) 12 | add_subdirectory(scrambledProperties) 13 | add_subdirectory(differentSlotCount) 14 | add_subdirectory(differentSlotType) 15 | add_subdirectory(differentSlotParamCount) 16 | add_subdirectory(differentSlotParamType) 17 | add_subdirectory(scrambledSlots) 18 | add_subdirectory(differentSignalCount) 19 | add_subdirectory(differentSignalParamCount) 20 | add_subdirectory(differentSignalParamType) 21 | add_subdirectory(scrambledSignals) 22 | add_subdirectory(state) 23 | if(QT_FEATURE_process) 24 | add_subdirectory(signatureTests) 25 | endif() 26 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentClassEnum/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentClassEnum Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentClassEnum 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentClassEnum 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentClassEnum/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestClass 4 | { 5 | ENUM ClassEnum {Null = 2, One, Two} 6 | 7 | PROP(TestEnum::Test testEnum) 8 | PROP(ClassEnum classEnum) 9 | 10 | PROP(int prop1); 11 | PROP(double prop2); 12 | 13 | SLOT(bool slot1()); 14 | SLOT(QString slot2()); 15 | 16 | SIGNAL(signal1()); 17 | SIGNAL(signal2()); 18 | 19 | SLOT(void ping(const QString &message)); 20 | SIGNAL(pong(const QString &message)); 21 | 22 | SLOT(bool quit()); 23 | }; 24 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentGlobalEnum/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentGlobalEnum Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentGlobalEnum 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentGlobalEnum 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentGlobalEnum/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {FALSE, TRUE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | SLOT(bool slot1()); 20 | SLOT(QString slot2()); 21 | 22 | CLASS childProp(TestChildClass); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentPropertyCount/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentPropertyCount Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentPropertyCount 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentPropertyCount 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentPropertyCount/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | PROP(double prop3); 19 | 20 | CLASS childProp(TestChildClass); 21 | 22 | SLOT(bool slot1()); 23 | SLOT(QString slot2()); 24 | 25 | SIGNAL(signal1()); 26 | SIGNAL(signal2()); 27 | 28 | SLOT(void ping(const QString &message)); 29 | SIGNAL(pong(const QString &message)); 30 | 31 | SLOT(bool quit()); 32 | }; 33 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentPropertyCountChild/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentPropertyCount Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentPropertyCountChild 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentPropertyCountChild 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentPropertyCountChild/differentPropertyCountChild.pro: -------------------------------------------------------------------------------- 1 | include(../mismatch.pri) 2 | 3 | TARGET = differentPropertyCountChild 4 | 5 | REPC_REPLICA = $$PWD/mismatch.rep 6 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentPropertyCountChild/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(double prop2); 6 | }; 7 | 8 | class TestClass 9 | { 10 | ENUM ClassEnum {Null, One, Two} 11 | 12 | PROP(TestEnum::Test testEnum) 13 | PROP(ClassEnum classEnum) 14 | 15 | PROP(int prop1); 16 | PROP(double prop2); 17 | 18 | CLASS childProp(TestChildClass); 19 | 20 | SLOT(bool slot1()); 21 | SLOT(QString slot2()); 22 | 23 | SIGNAL(signal1()); 24 | SIGNAL(signal2()); 25 | 26 | SLOT(void ping(const QString &message)); 27 | SIGNAL(pong(const QString &message)); 28 | 29 | SLOT(bool quit()); 30 | }; 31 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentPropertyType/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentPropertyType Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentPropertyType 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentPropertyType 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentPropertyType/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(QString prop2); 18 | 19 | SLOT(bool slot1()); 20 | SLOT(QString slot2()); 21 | 22 | CLASS childProp(TestChildClass); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSignalCount/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentSignalCount Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentSignalCount 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentSignalCount 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSignalCount/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(bool slot1()); 22 | SLOT(QString slot2()); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | SIGNAL(anotherSignal()); 27 | 28 | SLOT(void ping(const QString &message)); 29 | SIGNAL(pong(const QString &message)); 30 | 31 | SLOT(bool quit()); 32 | }; 33 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSignalParamCount/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentSignalParamCount Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentSignalParamCount 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentSignalParamCount 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSignalParamCount/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | SLOT(bool slot1()); 20 | SLOT(QString slot2()); 21 | 22 | CLASS childProp(TestChildClass); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QString &message, int anotherParam)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSignalParamType/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentSignalParamType Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentSignalParamType 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentSignalParamType 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSignalParamType/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(bool slot1()); 22 | SLOT(QString slot2()); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QByteArray &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSlotCount/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentSlotCount Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentSlotCount 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentSlotCount 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSlotCount/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(bool slot1()); 22 | SLOT(QString slot2()); 23 | SLOT(void anotherSlot()); 24 | 25 | SIGNAL(signal1()); 26 | SIGNAL(signal2()); 27 | 28 | SLOT(void ping(const QString &message)); 29 | SIGNAL(pong(const QString &message)); 30 | 31 | SLOT(bool quit()); 32 | }; 33 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSlotParamCount/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentSlotParamCount Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentSlotParamCount 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentSlotParamCount 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSlotParamCount/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(bool slot1()); 22 | SLOT(QString slot2()); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message, int anotherParam)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSlotParamType/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentSlotParamType Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentSlotParamType 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentSlotParamType 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSlotParamType/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(bool slot1()); 22 | SLOT(QString slot2()); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QByteArray &message)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSlotType/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## differentSlotType Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(differentSlotType 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(differentSlotType 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/differentSlotType/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(bool slot1()); 22 | SLOT(int slot2()); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/matchAndQuit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## matchAndQuit Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(matchAndQuit 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | INCLUDE_DIRECTORIES 14 | ${CMAKE_CURRENT_SOURCE_DIR} 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(matchAndQuit 20 | ../server.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/mismatch.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "rep_mismatch_replica.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class tst_Mismatch_Process : public QObject 11 | { 12 | Q_OBJECT 13 | 14 | private Q_SLOTS: 15 | void testRun() 16 | { 17 | QRemoteObjectNode repNode; 18 | repNode.connectToNode(QUrl(QStringLiteral("tcp://127.0.0.1:65214"))); 19 | QTest::ignoreMessage(QtWarningMsg, " Signature mismatch for TestClassReplica \"TestClass\""); 20 | QSharedPointer rep(repNode.acquire()); 21 | QTRY_COMPARE(rep->state(), QRemoteObjectReplica::SignatureMismatch); 22 | } 23 | }; 24 | 25 | QTEST_MAIN(tst_Mismatch_Process) 26 | 27 | #include "mismatch.moc" 28 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/mismatch.pri: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | QT += remoteobjects core testlib 3 | QT -= gui 4 | 5 | DESTDIR = ./ 6 | CONFIG += c++11 7 | CONFIG -= app_bundle 8 | 9 | INCLUDEPATH += $$PWD 10 | SOURCES += $$PWD/mismatch.cpp 11 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/scrambledProperties/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## scrambledProperties Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(scrambledProperties 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(scrambledProperties 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/scrambledProperties/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(double prop2); 17 | PROP(int prop1); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(bool slot1()); 22 | SLOT(QString slot2()); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/scrambledSignals/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## scrambledSignals Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(scrambledSignals 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(scrambledSignals 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/scrambledSignals/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(bool slot1()); 22 | SLOT(QString slot2()); 23 | 24 | SIGNAL(signal2()); 25 | SIGNAL(signal1()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/scrambledSlots/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## scrambledSlots Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(scrambledSlots 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ../mismatch.cpp 13 | INCLUDE_DIRECTORIES 14 | .. 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(scrambledSlots 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/scrambledSlots/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(QString slot2()); 22 | SLOT(bool slot1()); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/server.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(bool slot1()); 22 | SLOT(QString slot2()); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/signatureServer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## signatureServer Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(signatureServer 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | ${CMAKE_CURRENT_BINARY_DIR}/rep_server_source.h 13 | main.cpp 14 | INCLUDE_DIRECTORIES 15 | ${CMAKE_CURRENT_SOURCE_DIR} 16 | LIBRARIES 17 | Qt::RemoteObjects 18 | Qt::Test 19 | ) 20 | qt6_add_repc_sources(signatureServer 21 | ../server.rep 22 | ) 23 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/signatureTests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_signature Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_ro_signature 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | tst_signature.cpp 13 | LIBRARIES 14 | Qt::RemoteObjects 15 | ) 16 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/state/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## state Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(state 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | INCLUDE_DIRECTORIES 14 | ${CMAKE_CURRENT_SOURCE_DIR} 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(state 20 | mismatch.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/repc/signature/state/mismatch.rep: -------------------------------------------------------------------------------- 1 | ENUM Test {TRUE, FALSE} 2 | 3 | class TestChildClass 4 | { 5 | PROP(int prop1); 6 | PROP(double prop2); 7 | }; 8 | 9 | class TestClass 10 | { 11 | ENUM ClassEnum {Null, One, Two} 12 | 13 | PROP(TestEnum::Test testEnum) 14 | PROP(ClassEnum classEnum) 15 | 16 | PROP(int prop1); 17 | PROP(double prop2); 18 | 19 | CLASS childProp(TestChildClass); 20 | 21 | SLOT(QString slot2()); 22 | SLOT(bool slot1()); 23 | 24 | SIGNAL(signal1()); 25 | SIGNAL(signal2()); 26 | 27 | SLOT(void ping(const QString &message)); 28 | SIGNAL(pong(const QString &message)); 29 | 30 | SLOT(bool quit()); 31 | }; 32 | -------------------------------------------------------------------------------- /tests/auto/repcinlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | 6 | qt_add_library(repclib 7 | export_header.h 8 | ) 9 | 10 | target_link_libraries(repclib PUBLIC 11 | Qt::RemoteObjects 12 | ) 13 | target_compile_definitions(repclib PRIVATE QT_BUILD_REPCLIB_LIB) 14 | set_target_properties(repclib PROPERTIES 15 | C_VISIBILITY_PRESET hidden 16 | CXX_VISIBILITY_PRESET hidden 17 | OBJC_VISIBILITY_PRESET hidden 18 | OBJCXX_VISIBILITY_PRESET hidden 19 | VISIBILITY_INLINES_HIDDEN 1 20 | ) 21 | 22 | 23 | qt6_add_repc_merged(repclib 24 | classwithattributetest.rep 25 | ) 26 | 27 | qt_internal_add_test(tst_repcinlib 28 | SOURCES 29 | tst_repcinlib.cpp 30 | LIBRARIES 31 | repclib 32 | ) 33 | 34 | -------------------------------------------------------------------------------- /tests/auto/repcinlib/classwithattributetest.rep: -------------------------------------------------------------------------------- 1 | #include "export_header.h" 2 | 3 | POD Q_REPCLIB_EXPORT MyPod(int number) 4 | 5 | class Q_REPCLIB_EXPORT MyAttributeClass 6 | { 7 | PROP(bool myProp READONLY) 8 | MODEL tracks(title) 9 | } 10 | -------------------------------------------------------------------------------- /tests/auto/repcinlib/export_header.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | 5 | #ifndef QT_STATIC 6 | # if defined(QT_BUILD_REPCLIB_LIB) 7 | # define Q_REPCLIB_EXPORT Q_DECL_EXPORT 8 | # else 9 | # define Q_REPCLIB_EXPORT Q_DECL_IMPORT 10 | # endif 11 | #else 12 | # define Q_REPCLIB_EXPORT 13 | #endif 14 | -------------------------------------------------------------------------------- /tests/auto/repcinlib/tst_repcinlib.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "rep_classwithattributetest_merged.h" 5 | 6 | #include 7 | 8 | class tst_RepcInLib : public QObject { 9 | Q_OBJECT 10 | 11 | private Q_SLOTS: 12 | void instantiateClassesFromLib(); 13 | }; 14 | 15 | void tst_RepcInLib::instantiateClassesFromLib() 16 | { 17 | MyPod mypod; 18 | MyAttributeClassSimpleSource source; 19 | MyAttributeClassSourceAPI sourceAPI(&source); 20 | MyAttributeClassReplica replica; 21 | } 22 | 23 | QTEST_APPLESS_MAIN(tst_RepcInLib) 24 | 25 | #include "tst_repcinlib.moc" 26 | -------------------------------------------------------------------------------- /tests/auto/repcodegenerator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_repcodegenerator Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_repcodegenerator 10 | SOURCES 11 | tst_repcodegenerator.cpp 12 | LIBRARIES 13 | Qt::RemoteObjects 14 | ) 15 | qt6_add_repc_merged(tst_repcodegenerator 16 | classwithsignalonlytest.rep 17 | preprocessortest.rep 18 | classwithreadonlypropertytest.rep 19 | classwithattributetest.rep 20 | classinnamespace.rep 21 | ) 22 | 23 | ## Scopes: 24 | ##################################################################### 25 | -------------------------------------------------------------------------------- /tests/auto/repcodegenerator/classinnamespace.rep: -------------------------------------------------------------------------------- 1 | #HEADER namespace Test { 2 | #HEADER namespace MyNamespace { 3 | 4 | POD MyNamespacePod (int number) 5 | 6 | ENUM MyNamespaceEnum {Value1, Value2} 7 | 8 | class MyNamespaceClass 9 | { 10 | PROP(bool myProp READONLY) 11 | PROP(Test::MyNamespace::MyNamespaceEnumEnum::MyNamespaceEnum myEnum READONLY) 12 | MODEL tracks(title) 13 | SIGNAL(customSignal(Test::MyNamespace::MyNamespacePod pod)) 14 | } 15 | 16 | #FOOTER } // namespace MyNamespace 17 | #FOOTER } // namespace Test 18 | -------------------------------------------------------------------------------- /tests/auto/repcodegenerator/classwithattributetest.rep: -------------------------------------------------------------------------------- 1 | ENUM MyEnum {Foo, Bar} 2 | 3 | class Q_DECL_EXPORT MyAttributeClass 4 | { 5 | PROP(bool myProp READONLY) 6 | MODEL tracks(title) 7 | } 8 | -------------------------------------------------------------------------------- /tests/auto/repcodegenerator/classwithreadonlypropertytest.rep: -------------------------------------------------------------------------------- 1 | class MyReadOnlyPropClass 2 | { 3 | PROP(bool myProp READONLY) 4 | } 5 | -------------------------------------------------------------------------------- /tests/auto/repcodegenerator/classwithsignalonlytest.rep: -------------------------------------------------------------------------------- 1 | class MyClass 2 | { 3 | SIGNAL(mySignal(int)) 4 | } 5 | -------------------------------------------------------------------------------- /tests/auto/repcodegenerator/preprocessortest.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define PREPROCESSORTEST_MACRO 1 4 | -------------------------------------------------------------------------------- /tests/auto/repcodegenerator/tst_repcodegenerator.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "rep_preprocessortest_merged.h" 5 | #include "rep_classinnamespace_merged.h" 6 | 7 | #include 8 | 9 | class tst_RepCodeGenerator : public QObject { 10 | Q_OBJECT 11 | 12 | private Q_SLOTS: 13 | void testPreprocessorTestFile(); 14 | void testNamespaceTestFile(); 15 | }; 16 | 17 | void tst_RepCodeGenerator::testPreprocessorTestFile() 18 | { 19 | // could be a compile-time test, but let's just do something here 20 | QVERIFY(PREPROCESSORTEST_MACRO); 21 | } 22 | 23 | void tst_RepCodeGenerator::testNamespaceTestFile() 24 | { 25 | Test::MyNamespace::MyNamespaceClassReplica testReplica; 26 | Test::MyNamespace::MyNamespaceClassSimpleSource testSource; 27 | Test::MyNamespace::MyNamespacePod testpod; 28 | [[maybe_unused]] 29 | Test::MyNamespace::MyNamespaceEnumEnum::MyNamespaceEnum testenum = 30 | Test::MyNamespace::MyNamespaceEnumEnum::Value1; 31 | } 32 | 33 | QTEST_APPLESS_MAIN(tst_RepCodeGenerator) 34 | 35 | #include "tst_repcodegenerator.moc" 36 | -------------------------------------------------------------------------------- /tests/auto/repfiles/localdatacenter.rep: -------------------------------------------------------------------------------- 1 | class LocalDataCenter 2 | { 3 | PROP(int data1); 4 | PROP(float data2); 5 | PROP(QString data3); 6 | PROP(QList data4); 7 | SIGNAL(callMe(QList fun)); 8 | }; 9 | -------------------------------------------------------------------------------- /tests/auto/repfiles/tcpdatacenter.rep: -------------------------------------------------------------------------------- 1 | class TcpDataCenter 2 | { 3 | PROP(int data1); 4 | PROP(float data2); 5 | PROP(QString data3); 6 | PROP(QList data4); 7 | }; 8 | -------------------------------------------------------------------------------- /tests/auto/repparser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | ##################################################################### 5 | ## tst_parser Test: 6 | ##################################################################### 7 | 8 | set(REPPARSER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../src/repparser") 9 | 10 | qt_internal_add_test(tst_parser 11 | SOURCES 12 | tst_parser.cpp 13 | INCLUDE_DIRECTORIES 14 | ${REPPARSER_DIR} 15 | LIBRARIES 16 | Qt::CorePrivate 17 | ) 18 | 19 | # QLALR Grammars: 20 | qt_process_qlalr( 21 | tst_parser 22 | ${REPPARSER_DIR}/parser.g 23 | "--exit-on-warn" 24 | ) 25 | 26 | ## Scopes: 27 | ##################################################################### 28 | 29 | qt_internal_extend_target(tst_parser CONDITION MSVC 30 | COMPILE_OPTIONS 31 | /wd4129 32 | ) 33 | -------------------------------------------------------------------------------- /tests/auto/restart/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | add_subdirectory(client) 6 | add_subdirectory(server) 7 | add_subdirectory(tst) 8 | -------------------------------------------------------------------------------- /tests/auto/restart/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## restart_client Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(restart_client 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | INCLUDE_DIRECTORIES 14 | ${CMAKE_CURRENT_SOURCE_DIR} 15 | LIBRARIES 16 | Qt::RemoteObjects 17 | Qt::Test 18 | ) 19 | qt6_add_repc_replicas(restart_client 20 | ../subclass.rep 21 | ) 22 | -------------------------------------------------------------------------------- /tests/auto/restart/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## restart_server Binary: 7 | ##################################################################### 8 | 9 | qt_internal_add_executable(restart_server 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | main.cpp 13 | mytestserver.cpp mytestserver.h 14 | INCLUDE_DIRECTORIES 15 | ${CMAKE_CURRENT_SOURCE_DIR} 16 | LIBRARIES 17 | Qt::RemoteObjects 18 | Qt::Test 19 | ) 20 | qt6_add_repc_sources(restart_server 21 | ../subclass.rep 22 | ) 23 | -------------------------------------------------------------------------------- /tests/auto/restart/server/mytestserver.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | 6 | #include "mytestserver.h" 7 | #include "rep_subclass_source.h" 8 | 9 | MyTestServer::MyTestServer(QObject *parent) 10 | : ParentClassSimpleSource(parent) 11 | { 12 | qDebug() << "Server started"; 13 | } 14 | 15 | MyTestServer::~MyTestServer() 16 | { 17 | qDebug() << "Server stopped"; 18 | } 19 | 20 | bool MyTestServer::start() 21 | { 22 | setStarted(true); 23 | return true; 24 | } 25 | 26 | bool MyTestServer::quit() 27 | { 28 | emit quitApp(); 29 | return true; 30 | } 31 | -------------------------------------------------------------------------------- /tests/auto/restart/server/mytestserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef MYTESTSERVER_H 5 | #define MYTESTSERVER_H 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "rep_subclass_source.h" 13 | 14 | class MyTestServer : public ParentClassSimpleSource 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | MyTestServer(QObject *parent = nullptr); 20 | ~MyTestServer() override; 21 | 22 | public Q_SLOTS: 23 | bool start() override; 24 | bool quit() override; 25 | 26 | Q_SIGNALS: 27 | void quitApp(); 28 | }; 29 | 30 | #endif // MYTESTSERVER_H 31 | -------------------------------------------------------------------------------- /tests/auto/restart/subclass.rep: -------------------------------------------------------------------------------- 1 | POD MyPOD(int i, float f, QString s) 2 | 3 | class SubClass 4 | { 5 | PROP(MyPOD myPOD) 6 | } 7 | 8 | class ParentClass 9 | { 10 | PROP(bool started = false) 11 | 12 | SLOT(bool start()) 13 | SLOT(bool quit()) 14 | SIGNAL(advance()) 15 | 16 | CLASS subClass(SubClass) 17 | MODEL tracks(display) 18 | } 19 | 20 | -------------------------------------------------------------------------------- /tests/auto/restart/tst/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_restart Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_restart 10 | OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" 11 | SOURCES 12 | tst_restart.cpp 13 | LIBRARIES 14 | Qt::RemoteObjects 15 | ) 16 | -------------------------------------------------------------------------------- /tests/auto/subclassreplica/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | 5 | ##################################################################### 6 | ## tst_subclassreplicatest Test: 7 | ##################################################################### 8 | 9 | qt_internal_add_test(tst_subclassreplicatest 10 | SOURCES 11 | tst_subclassreplicatest.cpp 12 | DEFINES 13 | SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" 14 | LIBRARIES 15 | Qt::RemoteObjects 16 | ) 17 | qt6_add_repc_merged(tst_subclassreplicatest 18 | class.rep 19 | ) 20 | -------------------------------------------------------------------------------- /tests/auto/subclassreplica/class.rep: -------------------------------------------------------------------------------- 1 | class SubClass 2 | { 3 | PROP(int value) 4 | } 5 | class ParentClass 6 | { 7 | CLASS sub1(SubClass) 8 | CLASS sub2(SubClass) 9 | } 10 | 11 | class OtherParentClass 12 | { 13 | CLASS sub1(SubClass) 14 | } 15 | -------------------------------------------------------------------------------- /tests/global/global.cfg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/manual/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | add_subdirectory(examples) 5 | -------------------------------------------------------------------------------- /tests/manual/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | if(TARGET Qt::Quick AND UNIX AND NOT ANDROID) 5 | add_subdirectory(qmlmodelviewclient) 6 | endif() 7 | add_subdirectory(simpleswitch) 8 | if(TARGET Qt::Bluetooth AND TARGET Qt::Widgets) 9 | add_subdirectory(ble) 10 | endif() 11 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | add_subdirectory(bleclient) 5 | add_subdirectory(bleserver) 6 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/ble.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | bleclient \ 5 | bleserver 6 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/bleclient/bleclient.pro: -------------------------------------------------------------------------------- 1 | QT += widgets 2 | 3 | SOURCES += main.cpp \ 4 | connectpage.cpp \ 5 | mainwindow.cpp \ 6 | heaterview.cpp 7 | 8 | HEADERS += \ 9 | connectpage.h \ 10 | mainwindow.h \ 11 | heaterview.h 12 | 13 | FORMS += \ 14 | connectpage.ui \ 15 | heaterview.ui 16 | 17 | include(../common/common.pri) 18 | 19 | REPC_REPLICA = ../common/heater.rep 20 | 21 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/ble/bleclient 22 | INSTALLS += target 23 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/bleclient/heaterview.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // Copyright (C) 2019 Ford Motor Company 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 4 | 5 | #ifndef HEATERVIEW_H 6 | #define HEATERVIEW_H 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | class BLEIoDevice; 14 | class HeaterReplica; 15 | 16 | QT_BEGIN_NAMESPACE 17 | namespace Ui { 18 | class HeaterView; 19 | } 20 | QT_END_NAMESPACE 21 | 22 | class HeaterView : public QWidget 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | explicit HeaterView(BLEIoDevice *ioDevice, QWidget *parent = nullptr); 28 | ~HeaterView() override; 29 | 30 | signals: 31 | void closeMe(); 32 | void showMessage(const QString &message); 33 | 34 | private: 35 | Ui::HeaterView *ui; 36 | QRemoteObjectNode m_node; 37 | std::unique_ptr m_heater; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/bleclient/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // Copyright (C) 2019 Ford Motor Company 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 4 | 5 | #include "mainwindow.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | using namespace Qt::Literals::StringLiterals; 13 | 14 | int main(int argc, char **argv) 15 | { 16 | QApplication app(argc, argv); 17 | 18 | QCommandLineParser parser; 19 | parser.addHelpOption(); 20 | QCommandLineOption verboseOption("verbose", "Verbose mode"); 21 | parser.addOption(verboseOption); 22 | parser.process(app); 23 | if (parser.isSet(verboseOption)) { 24 | QLoggingCategory::setFilterRules("qt.remoteobjects* = true"_L1); 25 | QLoggingCategory::setFilterRules("qt.bluetooth* = true"_L1); 26 | } 27 | 28 | MainWindow w; 29 | w.show(); 30 | return app.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/bleclient/mainwindow.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // Copyright (C) 2019 Ford Motor Company 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 4 | 5 | #ifndef MAINWINDOW_H 6 | #define MAINWINDOW_H 7 | 8 | #include "connectpage.h" 9 | #include "heaterview.h" 10 | 11 | #include 12 | #include 13 | 14 | class MainWindow : public QMainWindow 15 | { 16 | Q_OBJECT 17 | public: 18 | explicit MainWindow(QWidget *parent = nullptr); 19 | 20 | signals: 21 | 22 | public slots: 23 | void showMessage(const QString &message); 24 | 25 | private: 26 | void showConnectPage(); 27 | 28 | private: 29 | QStackedWidget *m_stack; 30 | ConnectPage *m_connectPage; 31 | QPointer m_heaterView; 32 | }; 33 | 34 | #endif // MAINWINDOW_H 35 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/bleserver/bleserver.pro: -------------------------------------------------------------------------------- 1 | SOURCES += main.cpp 2 | 3 | include(../common/common.pri) 4 | 5 | REPC_SOURCE = ../common/heater.rep 6 | 7 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/ble/bleserver 8 | INSTALLS += target 9 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/common/Info.cmake.macos.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 7 | CFBundleIconFile 8 | ${MACOSX_BUNDLE_ICON_FILE} 9 | CFBundleIdentifier 10 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 11 | CFBundlePackageType 12 | APPL 13 | CFBundleSignature 14 | ???? 15 | LSMinimumSystemVersion 16 | ${CMAKE_OSX_DEPLOYMENT_TARGET} 17 | NSPrincipalClass 18 | NSApplication 19 | NSBluetoothAlwaysUsageDescription 20 | Qt RO Example wants to access your Bluetooth adapter 21 | NSSupportsAutomaticGraphicsSwitching 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/common/Info.qmake.macos.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleExecutable 6 | ${EXECUTABLE_NAME} 7 | CFBundleIconFile 8 | 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundlePackageType 12 | APPL 13 | CFBundleSignature 14 | ???? 15 | LSMinimumSystemVersion 16 | ${MACOSX_DEPLOYMENT_TARGET} 17 | NSPrincipalClass 18 | NSApplication 19 | NSBluetoothAlwaysUsageDescription 20 | Qt RO Example wants to access your Bluetooth adapter 21 | NSSupportsAutomaticGraphicsSwitching 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/common/common.pri: -------------------------------------------------------------------------------- 1 | QT += remoteobjects bluetooth 2 | 3 | CONFIG -= app_bundle 4 | 5 | INCLUDEPATH += $$PWD 6 | 7 | HEADERS += \ 8 | $$PWD/bleiodevice.h 9 | 10 | SOURCES += \ 11 | $$PWD/bleiodevice.cpp 12 | 13 | ios: QMAKE_INFO_PLIST = $$PWD/Info.ios.plist 14 | macos: QMAKE_INFO_PLIST = $$PWD/Info.qmake.macos.plist 15 | -------------------------------------------------------------------------------- /tests/manual/examples/ble/common/heater.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Heater 4 | { 5 | PROP(bool heaterPoweredOn=true); 6 | PROP(int currentTemperature=20 SOURCEONLYSETTER); 7 | }; 8 | -------------------------------------------------------------------------------- /tests/manual/examples/qmlmodelviewclient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(tst_qmlmodelviewclient VERSION "${QT_REPO_MODULE_VERSION}" LANGUAGES CXX) 6 | 7 | set(CMAKE_AUTOMOC ON) 8 | 9 | qt_internal_add_manual_test(tst_qmlmodelviewclient 10 | SOURCES 11 | main.cpp 12 | LIBRARIES 13 | Qt6::Core 14 | Qt6::Gui 15 | Qt6::Qml 16 | Qt6::Quick 17 | Qt6::RemoteObjects 18 | ) 19 | 20 | set_target_properties(tst_qmlmodelviewclient PROPERTIES 21 | WIN32_EXECUTABLE TRUE 22 | MACOSX_BUNDLE TRUE 23 | ) 24 | 25 | # Resources: 26 | set(qml_resource_files 27 | "main.qml" 28 | ) 29 | 30 | qt6_add_resources(tst_qmlmodelviewclient "qml" 31 | PREFIX 32 | "/" 33 | FILES 34 | ${qml_resource_files} 35 | ) 36 | -------------------------------------------------------------------------------- /tests/manual/examples/qmlmodelviewclient/doc/src/qmlmodelviewclient.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | 4 | /*! 5 | \example qmlmodelviewclient 6 | \title QML Model-View Client 7 | \brief Making a QAbstractItemModelReplica available to QML and using it from QML. 8 | \ingroup qtremoteobjects-examples 9 | 10 | This is an alternate client application you can use along with the \l {Model-View Server}. 11 | 12 | See the \l {Model-View Client} example for a 13 | more detailed explanation on how the model is acquired and used. 14 | */ 15 | -------------------------------------------------------------------------------- /tests/manual/examples/qmlmodelviewclient/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | QLoggingCategory::setFilterRules("qt.remoteobjects.debug=false\n" 13 | "qt.remoteobjects.warning=false\n" 14 | "qt.remoteobjects.models.debug=false\n" 15 | "qt.remoteobjects.models.debug=false"); 16 | 17 | QGuiApplication app(argc, argv); 18 | 19 | QRemoteObjectNode node(QUrl(QStringLiteral("local:registry"))); 20 | QQmlApplicationEngine engine; 21 | QScopedPointer model(node.acquireModel(QStringLiteral("RemoteModel"))); 22 | engine.rootContext()->setContextProperty("remoteModel", model.data()); 23 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 24 | 25 | return app.exec(); 26 | } 27 | -------------------------------------------------------------------------------- /tests/manual/examples/qmlmodelviewclient/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/manual/examples/qmlmodelviewclient/qmlmodelviewclient.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | QT += qml quick remoteobjects 4 | CONFIG += c++11 5 | 6 | SOURCES += main.cpp 7 | 8 | RESOURCES += qml.qrc 9 | 10 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/qmlmodelviewclient 11 | INSTALLS += target 12 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | if (NOT ANDROID) 5 | add_subdirectory(directconnectdynamicclient) 6 | add_subdirectory(registryconnectedclient) 7 | add_subdirectory(registryconnectedserver) 8 | endif() 9 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/directconnectdynamicclient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(tst_directconnectdynamicclient VERSION "${QT_REPO_MODULE_VERSION}" LANGUAGES CXX) 6 | 7 | if (ANDROID) 8 | message(FATAL_ERROR "This project cannot be built on Android.") 9 | endif() 10 | 11 | set(CMAKE_AUTOMOC ON) 12 | 13 | qt_internal_add_manual_test(tst_directconnectdynamicclient 14 | SOURCES 15 | main.cpp 16 | dynamicclient.cpp 17 | dynamicclient.h 18 | LIBRARIES 19 | Qt::Core 20 | Qt::RemoteObjects 21 | ) 22 | 23 | set_target_properties(tst_directconnectdynamicclient PROPERTIES 24 | WIN32_EXECUTABLE FALSE 25 | MACOSX_BUNDLE FALSE 26 | ) 27 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/directconnectdynamicclient/directconnectdynamicclient.pro: -------------------------------------------------------------------------------- 1 | QT += remoteobjects core 2 | 3 | QT -= gui 4 | 5 | TARGET = directconnectdynamicclient 6 | CONFIG += console 7 | CONFIG -= app_bundle 8 | 9 | TEMPLATE = app 10 | 11 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/simpleswitch/directconnectdynamicclient 12 | INSTALLS += target 13 | 14 | SOURCES += main.cpp \ 15 | dynamicclient.cpp 16 | 17 | HEADERS += \ 18 | dynamicclient.h 19 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/directconnectdynamicclient/dynamicclient.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef _DYNAMICCLIENT_H 5 | #define _DYNAMICCLIENT_H 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | class DynamicClient : public QObject 14 | { 15 | Q_OBJECT 16 | public: 17 | DynamicClient(QSharedPointer ptr); 18 | ~DynamicClient() override; 19 | 20 | Q_SIGNALS: 21 | void echoSwitchState(bool switchState);// this signal is connected with server_slot(..) slot of source object and echoes back switch state received from source 22 | 23 | public Q_SLOTS: 24 | void recSwitchState_slot(bool); // slot to receive source state 25 | void initConnection_slot(); 26 | 27 | private: 28 | bool clientSwitchState; // holds received server switch state 29 | QSharedPointer reptr;// holds reference to replica 30 | }; 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/directconnectdynamicclient/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | 6 | #include "dynamicclient.h" 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | QCoreApplication a(argc, argv); 11 | 12 | QSharedPointer ptr; // shared pointer to hold replica 13 | 14 | QRemoteObjectNode repNode; // create remote object node 15 | repNode.connectToNode(QUrl(QStringLiteral("local:replica"))); // connect with remote host node 16 | 17 | ptr.reset(repNode.acquireDynamic("SimpleSwitch")); // acquire replica of source from host node 18 | 19 | DynamicClient rswitch(ptr); // create client switch object and pass replica reference to it 20 | 21 | return a.exec(); 22 | } 23 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/registryconnectedclient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(tst_registryconnectedclient VERSION "${QT_REPO_MODULE_VERSION}" LANGUAGES CXX) 6 | 7 | if (ANDROID) 8 | message(FATAL_ERROR "This project cannot be built on Android.") 9 | endif() 10 | 11 | set(CMAKE_AUTOMOC ON) 12 | 13 | qt_internal_add_manual_test(tst_registryconnectedclient 14 | SOURCES 15 | main.cpp 16 | dynamicclient.cpp 17 | dynamicclient.h 18 | LIBRARIES 19 | Qt::Core 20 | Qt::RemoteObjects 21 | ) 22 | 23 | set_target_properties(tst_registryconnectedclient PROPERTIES 24 | WIN32_EXECUTABLE FALSE 25 | MACOSX_BUNDLE FALSE 26 | ) 27 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/registryconnectedclient/dynamicclient.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef _DYNAMICCLIENT_H 5 | #define _DYNAMICCLIENT_H 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | class DynamicClient : public QObject 14 | { 15 | Q_OBJECT 16 | public: 17 | DynamicClient(QSharedPointer ptr); 18 | ~DynamicClient() override; 19 | 20 | Q_SIGNALS: 21 | void echoSwitchState(bool switchState);// this signal is connected with server_slot(..) slot of source object and echoes back switch state received from source 22 | 23 | public Q_SLOTS: 24 | void recSwitchState_slot(bool); // slot to receive source state 25 | void initConnection_slot(); 26 | 27 | private: 28 | bool clientSwitchState; // holds received server switch state 29 | QSharedPointer reptr;// holds reference to replica 30 | }; 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/registryconnectedclient/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include "dynamicclient.h" 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QCoreApplication a(argc, argv); 10 | 11 | QSharedPointer ptr; // shared pointer to hold replica 12 | 13 | QRemoteObjectNode repNode(QUrl(QStringLiteral("local:registry"))); 14 | 15 | ptr.reset(repNode.acquireDynamic("SimpleSwitch")); // acquire replica of source from host node 16 | 17 | DynamicClient rswitch(ptr); // create client switch object and pass replica reference to it 18 | 19 | return a.exec(); 20 | } 21 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/registryconnectedclient/registryconnectedclient.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2015-02-13T15:22:50 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += remoteobjects core 8 | 9 | QT -= gui 10 | 11 | TARGET = registryconnectedclient 12 | CONFIG += console 13 | CONFIG -= app_bundle 14 | 15 | TEMPLATE = app 16 | 17 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/simpleswitch/registryconnectedclient 18 | INSTALLS += target 19 | 20 | SOURCES += main.cpp \ 21 | dynamicclient.cpp 22 | 23 | HEADERS += \ 24 | dynamicclient.h 25 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/registryconnectedserver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(tst_registryconnectedserver VERSION "${QT_REPO_MODULE_VERSION}" LANGUAGES CXX) 6 | 7 | if (ANDROID) 8 | message(FATAL_ERROR "This project cannot be built on Android.") 9 | endif() 10 | 11 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 12 | set(CMAKE_AUTOMOC ON) 13 | 14 | qt_internal_add_manual_test(tst_registryconnectedserver 15 | SOURCES 16 | main.cpp 17 | simpleswitch.cpp 18 | simpleswitch.h 19 | LIBRARIES 20 | Qt::Core 21 | Qt::RemoteObjects 22 | ) 23 | 24 | set_target_properties(tst_registryconnectedserver PROPERTIES 25 | WIN32_EXECUTABLE FALSE 26 | MACOSX_BUNDLE FALSE 27 | ) 28 | 29 | qt6_add_repc_sources(tst_registryconnectedserver 30 | simpleswitch.rep 31 | ) 32 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/registryconnectedserver/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include "simpleswitch.h" 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QCoreApplication a(argc, argv); 10 | 11 | SimpleSwitch srcSwitch; // create simple switch 12 | 13 | QRemoteObjectRegistryHost regNode(QUrl(QStringLiteral("local:registry"))); // create node that hosts registy 14 | QRemoteObjectHost srcNode(QUrl(QStringLiteral("local:replica")), QUrl(QStringLiteral("local:registry"))); // create node that will host source and connect to registry 15 | 16 | //Note, you can add srcSwitch directly to regNode if desired. 17 | //We use two Nodes here, as the regNode could easily be in a third process. 18 | 19 | srcNode.enableRemoting(&srcSwitch); // enable remoting of source object 20 | 21 | return a.exec(); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/registryconnectedserver/registryconnectedserver.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2015-02-13T15:02:06 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += remoteobjects core 8 | 9 | QT -= gui 10 | 11 | TARGET = registryconnectedserver 12 | CONFIG += console 13 | CONFIG -= app_bundle 14 | 15 | REPC_SOURCE = simpleswitch.rep 16 | 17 | 18 | TEMPLATE = app 19 | 20 | target.path = $$[QT_INSTALL_EXAMPLES]/remoteobjects/simpleswitch/registryconnectedserver 21 | INSTALLS += target 22 | 23 | SOURCES += main.cpp \ 24 | simpleswitch.cpp 25 | 26 | HEADERS += \ 27 | simpleswitch.h 28 | 29 | DISTFILES += \ 30 | simpleswitch.rep 31 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/registryconnectedserver/simpleswitch.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #ifndef SIMPLESWITCH_H 5 | #define SIMPLESWITCH_H 6 | 7 | #include "rep_simpleswitch_source.h" 8 | 9 | class SimpleSwitch : public SimpleSwitchSimpleSource 10 | { 11 | Q_OBJECT 12 | public: 13 | SimpleSwitch(QObject *parent = nullptr); 14 | ~SimpleSwitch() override; 15 | void server_slot(bool clientState) override; 16 | public Q_SLOTS: 17 | void timeout_slot(); 18 | private: 19 | QTimer *stateChangeTimer; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/registryconnectedserver/simpleswitch.rep: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class SimpleSwitch 4 | { 5 | PROP(bool currState=false); 6 | SLOT(void server_slot(bool clientState)); 7 | }; 8 | 9 | -------------------------------------------------------------------------------- /tests/manual/examples/simpleswitch/simpleswitch.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | directconnectdynamicclient \ 5 | registryconnectedclient \ 6 | registryconnectedserver 7 | -------------------------------------------------------------------------------- /tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | if(QT_FEATURE_commandlineparser) 5 | add_subdirectory(repc) 6 | endif() 7 | -------------------------------------------------------------------------------- /tools/repc/cppcodegenerator.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "cppcodegenerator.h" 9 | #include "utils.h" 10 | 11 | QT_BEGIN_NAMESPACE 12 | 13 | CppCodeGenerator::CppCodeGenerator(QIODevice *outputDevice) 14 | : m_outputDevice(outputDevice) 15 | { 16 | Q_ASSERT(m_outputDevice); 17 | } 18 | 19 | void CppCodeGenerator::generate(const QJsonArray &classList, bool alwaysGenerateClass /* = false */) 20 | { 21 | for (const QJsonValue cdef : classList) 22 | m_outputDevice->write(generateClass(cdef, alwaysGenerateClass)); 23 | 24 | m_outputDevice->write("\n"); 25 | } 26 | 27 | QT_END_NAMESPACE 28 | -------------------------------------------------------------------------------- /tools/repc/cppcodegenerator.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 3 | 4 | #ifndef CPPCODEGENERATOR_H 5 | #define CPPCODEGENERATOR_H 6 | 7 | QT_BEGIN_NAMESPACE 8 | class QJsonArray; 9 | class QIODevice; 10 | 11 | class CppCodeGenerator 12 | { 13 | public: 14 | CppCodeGenerator(QIODevice *outputDevice); 15 | 16 | void generate(const QJsonArray &classList, bool alwaysGenerateClass = false); 17 | 18 | private: 19 | QIODevice *m_outputDevice; 20 | }; 21 | 22 | QT_END_NAMESPACE 23 | 24 | #endif // CPPCODEGENERATOR_H 25 | -------------------------------------------------------------------------------- /tools/repc/repc.pro: -------------------------------------------------------------------------------- 1 | option(host_build) 2 | include(moc_copy/moc.pri) 3 | QT = core-private 4 | 5 | DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII QT_NO_CAST_FROM_BYTEARRAY QT_NO_URL_CAST_FROM_STRING 6 | DEFINES += RO_INSTALL_HEADERS=$$shell_quote(\"$$clean_path($$[QT_INSTALL_HEADERS]/QtRemoteObjects)\") 7 | msvc: QMAKE_CXXFLAGS += /wd4129 8 | 9 | CONFIG += qlalr 10 | QLALRSOURCES += $$QTRO_SOURCE_TREE/src/repparser/parser.g 11 | INCLUDEPATH += $$QTRO_SOURCE_TREE/src/repparser 12 | 13 | SOURCES += \ 14 | main.cpp \ 15 | repcodegenerator.cpp \ 16 | cppcodegenerator.cpp \ 17 | utils.cpp 18 | 19 | HEADERS += \ 20 | repcodegenerator.h \ 21 | cppcodegenerator.h \ 22 | utils.h 23 | 24 | QMAKE_TARGET_DESCRIPTION = "Qt Remote Objects Compiler" 25 | load(qt_tool) 26 | -------------------------------------------------------------------------------- /tools/repc/utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2017 Ford Motor Company 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 3 | 4 | #ifndef UTILS_H 5 | #define UTILS_H 6 | 7 | #include 8 | 9 | QT_BEGIN_NAMESPACE 10 | class QJsonValue; 11 | class QJsonArray; 12 | struct AST; 13 | 14 | QByteArray generateClass(const QJsonValue &cls, bool alwaysGenerateClass = false); 15 | AST classList2AST(const QJsonArray &classes); 16 | QT_END_NAMESPACE 17 | 18 | #endif // UTILS_H 19 | -------------------------------------------------------------------------------- /tools/tools.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | qtConfig(commandlineparser): { 3 | SUBDIRS += repc 4 | } 5 | --------------------------------------------------------------------------------