summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Update websocket example to use the new sub-protocol featureMårten Nordheim2022-11-221-6/+5
| | | | | | | | | | | This also fixes the example, which was erroring out when the server picked a sub-protocol due to a bug in QWebSocket Pick-to: 6.4 Task-number: QTBUG-108276 Change-Id: I582facd79bb5af7e068941d59e2d44b57a39aebc Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Reimplement QmlMqttClientMaurice Kalinowski2022-10-234-14/+158
| | | | | | | | | | | | | | | QMqttClient is not meant to be directly exported to QML. One reason is that it uses quint16 for port declaration to minimize size of the class. However, that is not properly handled on all platforms for the QML engine. Instead create a proper wrapper for the client and only expose required elements. Fixes: QTBUG-80440 Pick-to: 6.4 Change-Id: Id4066ce24338b0270af05b06c6216c1755dab533 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-238-8/+8
| | | | | | | Task-number: QTBUG-105718 Change-Id: I9caf6ad52cd6a0a63ce7ff37ce189ec4b368befd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Use QT_DISABLE_DEPRECATED_UP_TO instead of QT_DISABLE_DEPRECATED_BEFOREIvan Solovev2022-08-227-7/+7
| | | | | | Task-number: QTBUG-104944 Change-Id: I98c2a652abb366354710b57e2fea7eb22235c66f Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-078-0/+24
| | | | | | | | | | | | 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: I40135f08b4e89e8e034ec764ffed3273fc60646a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-1629-1306/+58
| | | | | | | | | | | 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: Ie4309963c8e17d4e7dad602f61a660246d5e23cb Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove .prev_CMakeLists.txtKai Köhne2022-03-232-59/+0
| | | | | | Pick-to: 6.3 Change-Id: I9f95857b917047b85936a651ece9a30a6f64d019 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Improve examples CMakeLists.txtKai Köhne2022-02-218-89/+36
| | | | | | | | | | | | | | | | | - Remove '# generated from xyz.pro' comment from 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 - 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: Idf2f3d5a09a496fa5c578bbeae84f3560549f1a9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> 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: If3e2e42c6a1540cf1c7e80bc7c3f3dfc28ee40eb Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Switch examples to build as isolated sub-buildsAlexandru Croitor2021-12-151-6/+6
| | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Change-Id: I8075a81431b71d0dd65b2fadce4c24a8a43e63b3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-176-7/+7
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I821f412f9dbe11ae99ffd888a7ab2ba415ed9379 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Disable usage of CMake API compatibility wrappersJoerg Bornemann2021-05-267-8/+40
| | | | | | | | | | Setting the QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS variable in the project ensures we ported away from old API calls. Task-number: QTBUG-86815 Change-Id: I589f0192370a932ac10088656eaee1e35a41ea73 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Regenerate projectsAlexandru Croitor2020-05-261-1/+1
| | | | | | | And use an updated coin instruction file. Change-Id: I852d38febe9ecaa86c516b7f4a0451d0f80d8011 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Merge remote-tracking branch 'origin/wip/cmake' into devAlexandru Croitor2020-05-2610-0/+398
|\ | | | | | | Change-Id: I5074da47986bcc826d3990238b02ebe7e6cc3d2e
| * Regenerate projectswip/cmakeMaurice Kalinowski2020-05-269-15/+51
| | | | | | | | | | Change-Id: I8b306c077030ffe1904d42f813f3b7cacc35a0c9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * Regenerate projectsAlexandru Croitor2019-11-156-9/+64
| | | | | | | | | | | | Change-Id: I7574a6156e4c340ba94007176287a5d1bcb7f9e1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Add initial support for cmakeMaurice Kalinowski2019-09-028-0/+307
| | | | | | | | | | Change-Id: I40153b0f225d67afebfaf3ff0b1c43a9c2f69b8c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-131-0/+2
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Id9db3547396bd82b170db8c3025e5060d4cbba3e
| * | Fix flaky installationMaurice Kalinowski2019-12-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In very few cases, the installation step for the console example might copy the configuration.h header of both subprojects concurrently. In that case Mac bails out with an error. Avoid this by iterating ordered. Change-Id: Ic9dde91b1200a04ae598210f8b432d6efdd5d5c8 Fixes: QTBUG-80363 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | Fix build with --no-widgetsMaurice Kalinowski2020-01-031-1/+1
|/ / | | | | | | | | | | | | | | | | Apparently a new configuration in our CI. Fixes: QTBUG-81064 Task-number: QTQAINFRA-2576 Change-Id: I022b56fd4fae487dfb84041c30ce061a28e5484c Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Examples: Remove ping buttonsMaurice Kalinowski2019-10-246-48/+16
| | | | | | | | | | | | | | | | | | | | Since dcf3bbb9802f9adf79ae08d5d697b3ded3f0cb97 introduced autoKeepAlive, users should not send a ping message manually unless it is disabled. Change-Id: I4b717e2aebc8f40cabf009d4df7e1d146988d434 Fixes: QTBUG-79444 Reviewed-by: hjk <hjk@qt.io>
* | Use nullptr instead of 0Maurice Kalinowski2019-10-242-2/+2
| | | | | | | | | | Change-Id: Id4c8b194ce8ff8ec94fafcf1169a0cc9717684ed Reviewed-by: hjk <hjk@qt.io>
* | Update usage for encrypted connectionv5.14.0-beta2v5.14.0-beta1Maurice Kalinowski2019-09-263-3/+7
|/ | | | | | | | | Use the QMqttClient::connectToHostEncrypted() version taking a QSslConfiguration instead of applying global settings. Furthermore, the deprecated version will be removed in Qt6. Change-Id: I4b2a9ff2616ed1c0c645d0081719f2d40c6e3b20 Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-281-1/+2
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/mqtt/mqtt.pro Change-Id: Ic76ff03e314e0d9761ba66372e19f546afcc7d6c
| * Fix build with -no-guiMaurice Kalinowski2019-06-201-1/+1
| | | | | | | | | | | | | | | | | | Examples requiring a user interface recently need to check for its availability. Task-number: QTQAINFRA-2576 Change-Id: I731dfee16bd1a9b5eb0396433213243dfa9b23da Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Add console examplesMaurice Kalinowski2018-12-207-0/+588
|/ | | | | | | | | | Other solutions provide minimal console applications for publishing and subscribing, which can then be used as tools. Task-number: QTBUG-69995 Task-number: QTBUG-71957 Change-Id: Ica4a856e25b540d089e1aa20f853b780c18d59dd Reviewed-by: hjk <hjk@qt.io>
* Examples: Visual clean upMaurice Kalinowski2018-12-122-13/+29
| | | | | | | | | The UI needed some minimal overhaul to be more consistent. Adapt the layouts. Change-Id: I7e3fdf38faca2264c768fd188bb381a78f6cf4d3 Fixes: QTBUG-64014 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add username and password editsv5.12.0-beta4Maurice Kalinowski2018-11-052-10/+42
| | | | | | | The example was missing that so far. Change-Id: I312dc4e67cb801313bb4811ceced4b78f985e9ab Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Move qWarning to categorized loggingMaurice Kalinowski2018-07-261-1/+1
| | | | | | | | | | qWarning could potentially quit an application while it is easily possible to recover from an error state. Hence avoid usage of qWarning inside the module. Task-number: QTBUG-69544 Change-Id: I7340f38d80e6716450fbcd0918226e9435d37daa Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add new QML example to publish topics/messagesPablo J. Rogina2018-07-207-0/+461
| | | | | | | | | | New QML-based example that allows to send topic/message (along with QoS and retain properties) based mainly on existing QML subscription example, in order to provide a way for showing the whole publish/subscription model in MQTT via QML applications. Change-Id: I1673177371297969098adf635e7a582c25e4d0c7 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Update qml subscription exampleMaurice Kalinowski2018-07-181-3/+4
| | | | | | | Give the window a proper title and also added some debug output. Change-Id: Iccdecb709cd872e1281a34434c4e811c6b7f5817 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* qdoc files always use FDL/commercial license comboAlex Blasche2018-03-015-165/+50
| | | | | | Change-Id: I349a0f4b104046272062979bccdef456bdca428e Reviewed-by: Andrew O'Doherty <andrew.odoherty@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Introduce specific types for topic names and filtersLorenz Haas2017-11-154-8/+8
| | | | | | | | | | | For "topics" the standard defines topic names and topic filters with specific characteristics. QMqttTopicName and QMqttTopicFilter implement this requirements. [ChangeLog][General] Added QMqttTopicName and QMqttTopicFilter Change-Id: Ie2b6851ec9249f20d05c4b8df3c2f27afc2be4b9 Reviewed-by: hjk <hjk@qt.io>
* Doc: Add screenshot and details to Qt MQTT example docsLeena Miettinen2017-11-082-4/+49
| | | | | Change-Id: Ib3f1eaac6bc09ee40ea0244c3445eee354f0d965 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Doc: Add screenshot and details to Simple MQTT Client example docsLeena Miettinen2017-11-082-2/+44
| | | | | Change-Id: Idd0549a40365f12dc7cbe1f73696cb6cef1138f4 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Doc: Add docs for MQTT Subscriptions exampleLeena Miettinen2017-10-262-3/+47
| | | | | Change-Id: Ia5c3b6cc76f6938f4b315215f0c8351f6ae434d9 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Doc: Adding and editing the docsMaurice Kalinowski2017-10-165-0/+306
| | | | | | | | | | | | While there has been some initial API documentation for the preview release, incorporate further updates to make the module fully documented. Additional minor updates due to API changes. Task-number: QTBUG-63362 Change-Id: Ib472e4d4d18d505e77fdef3c14483c31628f8546 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Use Qt5-style connect and QOverloadMaurice Kalinowski2017-10-122-2/+2
| | | | | Change-Id: I589649329858e074f0bbc1feb89bb4da2c1e25b2 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Resize example user interfacesMaurice Kalinowski2017-10-102-6/+6
| | | | | | | On some displays they appeared too small. Change-Id: Iea63f866b3fa7116a4bcb46397d38f4336018594 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Change signature of QMqttClient::subscribeMaurice Kalinowski2017-09-016-16/+15
| | | | | | | | | | | | Instead of returning a QSharedPointer, return the same pointer. This improves readability as well as using the subscription from a user perspective. The ownership has to stay with the client though, otherwise behavior is unexpected. Change-Id: I72d3c15a12faf45c9575af8b3a790dfff1a30c2a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Update signal signatureMaurice Kalinowski2017-08-302-2/+6
| | | | | Change-Id: Ie76f1bee3e6299ebd3f684faa7c3023716f7098e Reviewed-by: hjk <hjk@qt.io>
* Fix includes in exampleMaurice Kalinowski2017-08-301-2/+1
| | | | | Change-Id: I1cb67eabaaf3ef40f4e0fe07a2bf5a5852861fe2 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename ping receival signalMaurice Kalinowski2017-08-302-2/+2
| | | | | Change-Id: I52320fd58305a3ba38c77e2da8589c35b54cd73e Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove hardcoded test serverMaurice Kalinowski2017-08-302-2/+2
| | | | | Change-Id: I846a7247850648b5e0f63b91d1bd31caec0d185d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add module conditionals for examplesMaurice Kalinowski2017-07-031-3/+4
| | | | | Change-Id: Ibffb387d939f98fb3454148c56099a304e733e9c Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Add websocket exampleMaurice Kalinowski2017-06-207-1/+549
| | | | | | | | | | Beside QtWebSockets not officially supporting subprotocols, one can circumvent this using QNetworkRequest. Works nicely with hivemq, yet need to find a websocket server supporting MQTT 3.1.1. Change-Id: I889eca86b5b7e4a9752aa0b4cef525d3b8462ab0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Fix warningsMaurice Kalinowski2017-06-192-3/+3
| | | | | Change-Id: I80b21f973a697bbfcd66904c1caaaa52f3eae636 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Rename QMqttMessage::content to payloadMaurice Kalinowski2017-06-152-2/+2
| | | | | | | | This is a way more consistent naming. Change-Id: Id1236a76fc8f88f09a62490ec01370c1e13de4f8 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add QML exampleMaurice Kalinowski2017-06-157-1/+476
| | | | | | | | | Instead of providing an API for QML it was decided to rather showcase how to do this manually. Potentially this decision might be revisited at a later point. Change-Id: If274fa681b05733d755602c3d9837c809e41fc3d Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Clean up exampleMaurice Kalinowski2017-05-192-5/+5
| | | | | | | | - use const ref - prefer comma separated initializer list Change-Id: I69dbf7b9577ec7db721b174ca13b936b79d66023 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>