summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Correct license for example and snippet filesLucie Gérard2024-04-0414-14/+14
| | | | | | | | | | | | According to QUIP-18 [1], all example and snippet files should be LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I71c88d1ba956d8e2c03ae2a958eece693ded7bf1 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Move bluetooth examples to tests/manual/examplesØystein Heskestad2023-10-1126-1249/+0
| | | | | | | | | | These examples are more related to bluetooth than remote objects, and are out or date because they don't use the permission API. Task-number: QTBUG-112850 Pick-to: 6.6 6.5 Change-Id: Ic3059a8cf7a03583cc525db7c8021dd5b607115a Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Document simpleswitch examplesØystein Heskestad2023-10-111-0/+34
| | | | | | | Task-number: QTBUG-112850 Pick-to: 6.6 6.5 Change-Id: I43cc08101153f10c30cd8ffa38649fd8e84ddbd2 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Doc: Fix issues and enable documentation testing in CITopi Reinio2023-10-102-2/+4
| | | | | | | | | | | | | | | examples/remoteobjects/clientapp/doc/src/clientapp.qdoc: Cannot find file to quote from: clientapp/qml/plugins1.qml src/remoteobjects/qremoteobjectnode.cpp: Can't link to 'address' Mark the module free of documentation warnings and enable doc testing in the CI. Change-Id: Ia33991e615e74df54a7cebdfbe0aafe65b0c8cdb Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io> Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* Move some simpleswitch examples to tests/manual/examplesØystein Heskestad2023-09-2218-479/+1
| | | | | | | | | | There have already been created snippets based on these small examples used in the remote objects documentation. Task-number: QTBUG-112850 Pick-to: 6.6 6.5 Change-Id: Ib495eea8f8416831229961acd8f873b943da317d Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Revamp clientapp example to prefer QML types over C++ classesØystein Heskestad2023-09-1416-135/+86
| | | | | | | | Replace C++ with more succinct QML. Task-number: QTBUG-112850 Change-Id: Ibd3ddcafdee0e6a47e83612cd11873a1656e7844 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Exclude sslserver and sslcppclient examples for Android buildElias Hautala2023-08-213-2/+12
| | | | | | | | | Excludes Sslserver and sslcppcilent examples from Android build because these can't be buil for Android. Task-number: QTBUG-111933 Change-Id: I444b0c51bc5b3540fcab47a9ff54cfc9d82020f0 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* ble example: fix namespaced buildsMarc Mutz2023-08-024-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The forward declaration of class QLowEnergyService in bleiodevice.h sits at global scope, so declares a second QLowEnergyService in namespaced builds, and makes the following uses of the name ambiguous. Unlike in the websockets example fixed in an earlier commit, here GCC actually complains about the UB: connectpage.cpp:129:21: required from here qpointer.h:54:17: error: invalid ‘static_cast’ from type ‘QLowEnergyService*’ to type ‘Qt6::QPointer<QLowEnergyService>::QObjectType*’ {aka ‘Qt6::QObject*’} 54 | { wp.assign(static_cast<QObjectType*>(p)); return *this; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ connectpage.h:18:7: note: class type ‘QLowEnergyService’ is incomplete 18 | class QLowEnergyService; | ^~~~~~~~~~~~~~~~~ Fix by replacing the forward declaration with an include. The other types are actually used in-name-only, so keep the forward declarations, but wrap them in QT_BEGIN_NAMESPACE/QT_END_NAMESPACE. Add a missing <memory> include for unique_ptr. Amends 846d26ca8ff95593aa44d32556b05da58ed94aa1. Pick-to: 6.6 6.5 Change-Id: I277ca4896a8dc7fd8a36848c9caa352297635c05 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* websockets example: fix namespaced buildsMarc Mutz2023-08-022-4/+1
| | | | | | | | | | | | | | | | | | | | | The forward declaration of class QWebSocket in websocketiodevice.h sits at global scope, so declares a second QWebSocket in namespaced builds, and makes the following uses of the name ambiguous. Fix by replacing the forward declaration with an include. This is preferable over QT_FORWARD_DECLARE_CLASS, because ~WebSocketIoDevice() is inline, and QPointer<QWebSocket>::~QPointer() kinda needs to know its payload in-size. The alternative would be to use QT_FORWARD_DECLARE_CLASS and make the destructor out-of-line. This solution is simpler. Amends b8a71125f038b5a52d034b804d32ecddd9e19286. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: I8c8dc2a772497c499a708ddb84e7ae6bc56c92bc Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
* Doc: Change category of examples to ConnectivityØystein Heskestad2023-07-314-4/+4
| | | | | | | Task-number: QTBUG-112850 Pick-to: 6.5 6.6 Change-Id: Ia64f25ac509daab632eca1152226beed0b74db65 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Add \examplecategory to Qt RemoteObjectsVenugopal Shivashankar2023-07-193-0/+3
| | | | | | | | | | Task-number: QTBUG-115300 Pick-to: 6.5 6.6 Change-Id: I830121b04cf0d184069e71564f68b932821118b4 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Doc: Update example category namesKai Köhne2023-07-102-2/+2
| | | | | | Pick-to: 6.5 6.6 Change-Id: Ia1b6a981945c22302e0e31f861a9044711390172 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Revamp clientapp and remoteobjects_server examplesØystein Heskestad2023-07-0630-287/+258
| | | | | | | | | | Merge clientapp and plugins into a single stand-alone example. Add documentation of clientapp and remoteobjects_server. Task-number: QTBUG-112850 Pick-to: 6.6 6.5 Change-Id: I03340d3208fac7448f7de5d7720a61d2eeaf5a0a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Delete cppclient exampleØystein Heskestad2023-06-066-125/+0
| | | | | | | | | This example does not add anything not covered by other examples. Task-number: QTBUG-112850 Pick-to: 6.5 6.6 Change-Id: Iaca69aa025d36dbc539904c72ed4aef8476a6b12 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Revamp WebSockets exampleØystein Heskestad2023-06-063-5/+76
| | | | | | | | | Fix a warning, expand the documentation, and add a picture to it. Task-number: QTBUG-112850 Pick-to: 6.5 6.6 Change-Id: I203392a95bef206fecc2777d060e215d95235296 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Revamp SSL exampleØystein Heskestad2023-06-0611-142/+150
| | | | | | | | | | | | The example did not work because the two applications used different rep-files to generate the remote objects. Use the same file in both applications, fix usage of case in naming, expand the documentation, and add a picture. Remove unused PresetData from rep-file. Task-number: QTBUG-112850 Pick-to: 6.5 6.6 Change-Id: Ia7aafc52d647bca9ffec12b8dd548377f20b6ce4 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Regenerate certsMårten Nordheim2023-05-3114-260/+268
| | | | | | | | | | They expired Pick-to: 6.5 6.2 5.15 Change-Id: I3276895b208a2dbb4d9efb6a8cf67915913c63e8 Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move qmlmodelviewclient example to tests/manual/examplesØystein Heskestad2023-05-268-168/+0
| | | | | | | | | | | | | This QML example does not work properly. It only shows a single column because it uses ListView. If it is reworked to use TreeView, there are still a lot of issues. Like that setBackground on the server side sets the background role to a QBrush, but only QColor is currently supported in QML. Task-number: QTBUG-112850 Pick-to: 6.5 Change-Id: Ib3224052d1a25bcece31f3ea69c01713f422ef22 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Disable cmdline-only examples on AndroidVille Voutilainen2023-05-125-4/+20
| | | | | | | Task-number:QTBUG-111933 Change-Id: I361a3f86d3bc0cce4be534630930f61e639acf43 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Disable cmdline-only examples on AndroidVille Voutilainen2023-05-054-2/+14
| | | | | | | Task-number:QTBUG-111933 Change-Id: Ib86bcca2a06538357dfc77b1b9610046f401bda8 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Suppress the QTP0001 policy warningAmir Masoud Abdol2023-01-271-0/+1
| | | | | | Pick-to: 6.5 Change-Id: If7b3b5388aaf1c2dd7d63b149046655e2d43f5ff Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Enable QtRemoteObjects example documentationJuha Vuolle2022-09-236-23/+23
| | | | | | | | | | | | | This commit adds the example listing page and a link to it on the module's landing page. The examples that had the 'qdoc' file are included in the listing. Few examples' documentation is quite limited, but those can be addresed in their own tasks as needed. Fixes: QTBUG-105943 Change-Id: Id69baead6fa5a2a62a3ce7fdf3d7e6be06cc851d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add QtRO over BT LE exampleBogDan Vatra2022-08-2926-0/+1241
| | | | | | | | | | | | | | | | | This commit adds Qt remote object example which demonstrates remote objects over Bluetooth Low Energy (LE). The example uses GATT characteristics and their value notifications as the transport method. The source (server) side is a simple "heater" object which is either turned ON or OFF, as controlled by the client. The temperature then changes upwards (heats) or downwards (cools) accordingly. The changing temperature value is shown by the client GUI. Fixes: QTBUG-99576 Change-Id: I70dff545db0e45e3026ed5a7a98fce7bf54b9821 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2320-20/+20
| | | | | | | Task-number: QTBUG-105718 Change-Id: I3c41abc9bca22c7395fa8bbacb853e2081491d5f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-0720-0/+60
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I645192906c25043651ee09447a2d98e70330a39c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-1449-2286/+98
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I315d7ce1d6c6c3497afdfe8b61a113fdc181c935 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove .prev_CMakeLists.txtKai Köhne2022-03-221-20/+0
| | | | | | Pick-to: 6.3 Change-Id: I0b2e1a760caf05e33a0df2d56088417d9a086d01 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Improve examples CMakeLists.txtKai Köhne2022-03-0121-170/+65
| | | | | | | | | | | | | | | | | | - Remove # generated from xyz.pro comment from pro2cmake - Remove "# special case" markers for pro2cmake - Remove automatic use of CMAKE_AUTORCC - Only opt into CMAKE_AUTOUIC if .ui files are involved - Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR, if not required by qt6_add_repc-* - Combine multiple find_package(Qt6 ... calls) - use REQUIRED COMPONENTS - sort components alphabetically - Fix wrong indentations - Use (only) one empty line after multi-line commands Pick-to: 6.3 Change-Id: Idd8ad59c9f5dd9a6675ef83d589ad2e6d3e0a9c0 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Switch examples to build as isolated sub-builds part 2Alexandru Croitor2022-02-051-1/+1
| | | | | | | | | | | | | | | qt_examples_build_begin needs the EXTERNAL_BUILD flag to know that it's safe to build examples as ExternalProjects. It still won't do it in CI until we enable building examples as ExternalProjects for prefix builds. This is preparation for that. Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Change-Id: Ia834c0f1bba6ca354ae9b3a0bb5bfb51f085ebb3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Switch examples to build as isolated sub-buildsAlexandru Croitor2021-12-154-16/+16
| | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Change-Id: Id67d82c171c6c2856de5abe911ff5f6931a05580 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-1716-16/+16
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I821f412f9dbe11ae99ffd888a7ab2ba415ed9379 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make server example name more uniqueAllan Sandfeld Jensen2021-07-137-10/+10
| | | | | | | | | | It clashes with other examples in other modules breaking top-builds with examples. Pick-to: 6.2 Change-Id: I5c0b3adfe1e6a81012a96f248b48c43976f2d2ad Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Update to latest qml CMake APIAlexandru Croitor2021-06-051-1/+0
| | | | | | Task-number: QTBUG-91621 Change-Id: I35ef90f6df40fac3808fb19054c66d73b18137c8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Make qt6_add_repc_{replica, source} pluralSona Kurazyan2021-05-318-8/+8
| | | | | | | | | Since these functions can take multiple *.rep files, it makes sense to make them plural. Change-Id: I99894e9ee1f6f0035eb8c3e5cdd1292316324577 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Use fixed qt_add_resource BASE argumentJoerg Bornemann2021-05-204-91/+28
| | | | | | | | Task-number: QTBUG-86726 Change-Id: I60decd981520475caccf112967afb82928612995 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Rename the target name for the example's qml pluginSona Kurazyan2021-05-063-9/+9
| | | | | | | | | | qtdeclarative has a target named 'qmlqtimeexampleplugin', it clashes with the same name in qtremoteobjects when building all modules in qt5.git. Renamed qmlqtimeexampleplugin -> qmlqrotimeexampleplugin. Fixes: QTBUG-93491 Change-Id: I5149de4d6a719eed16baf2f97ae748e85b39b066 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add some introductory documentation to a few more examplesMårten Nordheim2021-03-243-0/+108
| | | | | | | | | | | This way they will show up in the examples section for Remote Objects. Didn't document them as much as the previous example as they're not doing the Remote Objects parts very differently, but they are covering niches which are very important. Change-Id: I9bbd26a3fb8b2cf8a409464d9807daafc2558ac2 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Document the modelviewclient and server examplesMårten Nordheim2021-03-244-18/+168
| | | | | | | | | | | | They're simple, which makes them easy to follow. Adjusted the qtremoteobjects.qdocconf file as it wasn't working with the examples on my Linux machine at least. Task-number: QTBUG-90848 Change-Id: Id674585835717be87344f3f694ab77128ecb5344 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove old instructions for generating tls certificatesMårten Nordheim2021-03-231-15/+0
| | | | | | | Amends b03bf04c19d4d9b81f92bd9a30ee7d26317a7315 Change-Id: Ib7fbd69cf8f426f341b4a14c7be4d632ab30e6c1 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix error in websocket exampleMårten Nordheim2021-03-231-1/+1
| | | | | | | | | std::min fails to deduce the correct type to use now that QByteArray::size returns qsizetype instead of always returning int. A cast is needed on 32-bit now though, so let's cast to 64-bit. Change-Id: Ib3acd06527f87ccd807d8bdba64e62809da5f858 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Migrate from old signal/slot connection syntax (part 2)Sona Kurazyan2021-02-262-10/+10
| | | | | | | | | Change the syntax also for the connections that involve types that are defined in the repc-generated files. Pick-to: 5.15 5.12 Change-Id: I222a59c8fae438c5f0026e66a75d0fa905e49ccf Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Migrate from old signal/slot connection syntaxSona Kurazyan2021-02-258-22/+24
| | | | | | | | | | Exception is made for the cases, when the signals/slots are not known at compile-time (i.e. involve dynamic replicas) or are defined in the repc-generated files. Pick-to: 5.15 5.12 Change-Id: Ice1fc78b59c713480531292a0401795df75523d7 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Regenerate certificates to match new macOS 10.15 restrictionsMårten Nordheim2021-02-2416-252/+254
| | | | | | | | | | | The server cert needs to have the 'domain' in the extensions, not just in the CommonName and it also needs to have the extended key usage 'server'. Pick-to: 5.15 Change-Id: If9dc40281bf7af2157baa2cb1e6831c3a82bc6f2 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Clean-up warningsSona Kurazyan2021-02-223-5/+5
| | | | | | | | | | | | | Fixed the following warnings: - empty expression statement has no effect; remove unnecessary ';' - use of old-style cast - zero as null pointer constant - other minor things Change-Id: Ia672f48d2aa87c59354fc93fd19862f1875e13db Reviewed-by: Brett Stottlemyer <bstottle@ford.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use QList instead of QVectorJarek Kobus2021-02-162-2/+2
| | | | | | | | | Task-number: QTBUG-84469 Task-number: QTBUG-90907 Change-Id: Ifc6f05fb5e17e32ec04b383770080e812c854510 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Regenerate CMake projectsSona Kurazyan2021-02-1516-15/+79
| | | | | | Task-number: QTBUG-90686 Change-Id: I721eb88e638c83916884b7e7cf56dfa379baba86 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Pass QDate by valueEdward Welbourne2020-08-141-1/+1
| | | | | | | It's a trivially-copyable value type, just wrapping a qint64. Change-Id: I3cd2002b402eda479786e9367f834accd01fdabf Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
* Update via run_pro2cmake.pyBrett Stottlemyer2020-06-2916-24/+82
| | | | | | | ... and address special cases Change-Id: I2ceb88e9505c59fe48dd4612cfed82935eb2dfc4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/wip/cmake' into devAlexandru Croitor2020-06-1622-0/+804
|\ | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: I01be97466ce583c1852c00986d1e925dda80038c
| * Regenerate projectswip/cmakeAlexandru Croitor2019-11-155-5/+5
| | | | | | | | | | | | Change-Id: I08414933bad2e94f8f9a12ac7372570e838e31cd Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>