summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Use the \examplecategory macro to tag examplesTopi Reinio2023-04-128-8/+8
| | | | | | | | | | | | | | | | The '\meta category' command was used for tagging examples with a specific category, used in Qt Creators Welcome mode. As we want to also generate lists of examples belonging to a category elsewhere in the documentation, replace the command with a macro that expands to the original \meta command and also adds the example to a group using the \ingroup command. This way, the category names can be used as arguments to the \generatelist or \annotatedlist commands. Pick-to: 6.5 Task-number: QTBUG-112731 Change-Id: Ia1b34175e10109eef055b2759705f0ca0521179a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Make endpoint configurable for echoclient and sslechoclient examplesØystein Heskestad2023-03-245-19/+67
| | | | | | | | | Add handling of command line arguments for hostname and port. Task-number: QTBUG-110894 Pick-to: 6.5 Change-Id: I22d8f9e112cfb6c02b3e741c14720a0f28565984 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Expand documentation of examplesØystein Heskestad2023-03-1514-34/+124
| | | | | | | | | | | | | Add to the documentation to include what the examples do and how they do it, to make it easier for users to decide if an example is worth looking into, instead of how it was where they had to look at the code in the examples to decide if they are relevant for their purposes. Also added pictures to the examples. Task-number: QTBUG-110894 Pick-to: 6.5 Change-Id: I2751939e9f9716cd970e5fa938dabf042f369329 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* sslechoclient example: Verify server certificateIevgenii Meshcheriakov2023-03-143-7/+23
| | | | | | | | | | Exit the application in case of any SSL errors instead of ignoring them. Fixes: QTBUG-108654 Pick-to: 6.5 Change-Id: Id209930c29fd434e2ede7a4d38452296e8cfb6f2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
* Fix QML WebSocket Client ExampleØystein Heskestad2023-02-101-5/+5
| | | | | | | | | | | | The client was connecting to echo.websocket.org which is permanently down. Connect to ws.ifelse.io instead. Also fix signal handlers to use JavaScript functions with formal arguments, because signal handlers should no longer rely on injection of parameters. Task-number: QTBUG-110894 Pick-to: 6.5 Change-Id: I6d8999424ab41d153a6c0adbb04d7fac30a213da Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix QML WebSocket Server ExampleØystein Heskestad2023-02-101-2/+12
| | | | | | | | | | | | Client websocket did not connect to websocket server before, but now connects to server after server has started. Also fix signal handlers to use JavaScript functions with formal arguments, because signal handlers should no longer rely on injection of parameters. Task-number: QTBUG-110894 Pick-to: 6.5 Change-Id: I02242e26bad85fe94c0d3b1ea4b9dd4b2c0cbcfd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: Ib7233b40047e539a08daece8bbc4576f0ced7026 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-239-9/+9
| | | | | | | Task-number: QTBUG-105718 Change-Id: I9ae1ecc59e30cadaa8aaef762c86126c58e32bf0 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-079-0/+27
| | | | | | | | | | | | | 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: I65958aab98f3b821ad8154b3d0d09504c9c7537b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-1027-1323/+54
| | | | | | | | | | | 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: Ief6ca28118c5ce0abe5dccf1854731cf2215e2b6 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Improve examples CMakeLists.txtKai Köhne2022-02-199-70/+28
| | | | | | | | | | | | | | | | | - 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: I03507e56c961cfd6ae138473437dfafe478d3233 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: I20c9ce497ef32295bab9876caa5ea12dcc68896d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Switch examples to build as isolated sub-buildsAlexandru Croitor2021-12-151-7/+7
| | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Change-Id: Iac4cb61d45a9ca0d19ebc1f43bf281cb2dc52f10 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-177-7/+7
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I65f6b8794ee47405d888636be7dd416f65c769f8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Avoid exe name conflictAllan Sandfeld Jensen2021-05-122-6/+6
| | | | | | | We have other examples using a 'chatserver' executable Change-Id: Ibcea3ccbf4ce6b14753acbc04a743670468344ca Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-12-107-0/+28
| | | | | | | | As well as the MACOSX_BUNDLE properties as necessary. Task-number: QTBUG-87664 Change-Id: I75fa3596c08b5246a61572f31dc0b6ff1ccb8b2a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-12-107-7/+7
| | | | | | Task-number: QTBUG-87661 Change-Id: Ia908301554d7cecc73528ed21252299df1fc86fe Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* CMake: Regenerate projectsAlexandru Croitor2020-06-247-7/+35
| | | | | | | | | | Mostly needed for src/ project, to build websockets without checking for the textcodec feature. Amends aeeaa00fa083ac339d0770d633d22f203c504253 Change-Id: I90cd219294575c763501e47b9025e8a50017641a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-231-1/+0
|\ | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: I1608720522e974c7107f00599a9fb70f17865189
| * Stop forcing deprecated ssl protocol versionMårten Nordheim2020-01-171-1/+0
| | | | | | | | | | Change-Id: I422a2498bb940f801484d3f2e6e5d59edd637514 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Regenerate projectsAlexandru Croitor2019-11-152-2/+2
| | | | | | | | | | | | Change-Id: Ie454c70664c94743c0323d3d5fb8d4d7f224f3f1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate before mergeAlexandru Croitor2019-10-157-13/+13
| | | | | | | | | | Change-Id: I9f22f5d050aeec3e8c308e286a897f0f524ed8e3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add initial-support for cmakeMaurice Kalinowski2019-09-169-0/+268
|/ | | | | | | Task-number: QTBUG-78180 Change-Id: If6cf82c61d605332402feffca9bde2ea0dd6e313 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove usages of deprecated QLatin1LiteralSona Kurazyan2019-06-251-1/+1
| | | | | | | | Task-number: QTBUG-76491 Change-Id: I201455eb4a7868728334403b61d5e41529478677 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Remove \l from reference to example source fileNico Vertriest2019-03-251-1/+1
| | | | | | | | Replace with \c since it is no longer possible to put hard links to example source files Change-Id: Iaf35f88a37b3c74455550316b83c26bc28769d3c Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Remove redundant options and a stray defineJesus Fernandez2018-08-177-11/+7
| | | | | Change-Id: Ic7ce11f1631197e6ee019b66c0d7ec56590c5ab5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use override keywordJesus Fernandez2018-08-102-2/+2
| | | | | Change-Id: I120dcb26eb451930d02e452cc47262eda44cc77c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Replace typedefs by QOverloadAndré Klitzing2017-10-301-2/+1
| | | | | | Change-Id: I509332fa23bcf2cf2e6c10b7edacb4157f025ff9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-114-22/+40
|\ | | | | | | | | | | | | Conflicts: examples/websockets/simplechat/chatserver.cpp Change-Id: I98697cef4c05516b5b4122ad81c084546d57115f
| * Revamp WebSocket's simple-chat examplev5.10.0-beta1Mårten Nordheim2017-09-284-23/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | - Replace Q_* macros with their 'modern' substitutes - Replace a usage of qDebug with QTextStream - Print a little piece of text whenever a client connects - Add a textbox to the html page to set the host to connect to - Enable/disable disconnect and send button based on connection Task-number: QTBUG-60656 Change-Id: Ieec571c3964f94cd464912054acda3208c02c898 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Replace Q_NULLPTR with nullptrKevin Funk2017-09-267-7/+7
|/ | | | | Change-Id: I0988a4119b5bd790d286c16b5647d97d4d95aef0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make sure we find the ssl feature from QtNetworkv5.8.0-beta1Lars Knoll2016-09-141-0/+1
| | | | | | | | Required to be able to continue to compile this module with the modularized configure Change-Id: I9c929a1ab8e856922bacb92ca17c8e1588fa591b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Eradicate Q_FOREACH and Java-style loops and mark the module as Q_FOREACH-freeMarc Mutz2016-09-071-2/+1
| | | | | | Change-Id: I200f72423f13b54c636e995b120a70968b0e0758 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up QT_CONFIG usageLars Knoll2016-08-191-1/+1
| | | | | | | Use the newer qtConfig() method instead. Change-Id: I197dbe01edaf8696ee06d30400bd18e53cf69c94 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-247-3/+24
|\ | | | | | | Change-Id: Ic4a2b48535dd9b22a950b84de4bfa2728a859902
| * Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-rc1Liang Qi2016-05-197-3/+24
| |\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I80cd189fc82481fdc2241db6d2a7d95537c340a6
| | * add example installsOswald Buddenhagen2016-05-067-3/+24
| | | | | | | | | | | | | | | Change-Id: I49d9fda43374776685d2ab1fa653287447d34028 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | No need to manually call the default constructorFrank Meerkoetter2016-04-074-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | Cleaning up the examples a little. There is no need to explicitly call the default constructor for these members. Change-Id: I7a931ea78f6db1bc1c70f7c49bc85f51e8666d47 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | | Remove dead codeFrank Meerkoetter2016-04-071-1/+0
|/ / | | | | | | | | Change-Id: I528533bffe34e0df66b4a5b7aad98d54e3ce718c Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-2027-470/+929
|/ | | | | | | | | | From Qt 5.7 -> examples are lisenced under BSD license, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new BSD header instead of LGPL21 one (in those files which will be under BSD) Change-Id: I0166fb7434185f9d151631a51124945150cdd633 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix qmldir for qmlwebsockets_compatLiang Qi2015-05-222-2/+2
| | | | | | | | | It is not supported to have both "import Qt.WebSockets 1.0" and "import QtWebSockets 1.0" in the same project. Task-number: QTBUG-46205 Change-Id: I71b824b091f4491b8ab5e1eae8290a51159b03e2 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-03-173-2/+10
|\ | | | | | | Change-Id: I3dec06c8b49480a8225ef3487c4c76a4fa05b01c
| * Examples: fix certificate files for shadow build in sslechoserverLiang Qi2015-03-093-2/+10
| | | | | | | | | | | | Change-Id: I2e5c35586c3cdc153abf9a70ee1ed6bba7894ecb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-253-6/+32
|\ \ | |/ | | | | Change-Id: I218b5069480f60b88390c8540f01c3dbbee485d0
| * Example: echoserver should not close when it got a new connectionLiang Qi2015-02-201-1/+0
| | | | | | | | | | | | | | Otherwise it's just a onetime server. Change-Id: Ida516614e72cac1635062a04a6f1f9e1c56753da Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
| * Examples: add options for port and debug outputs in echoserverLiang Qi2015-02-203-5/+32
| | | | | | | | | | | | | | Change-Id: Iadba1c5cb7cd4454b01a98339c2225483b08e180 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5Frederik Gladhorn2015-02-245-7/+33
|\ \ | |/
| * Examples: add an option for debug outputs in echoclientLiang Qi2015-02-173-6/+25
| | | | | | | | | | Change-Id: I9bec2324b666c00212135ef6c9d5a69594cda050 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| * Doc: add description and image for echoclient htmlLiang Qi2015-02-132-1/+8
| | | | | | | | | | Change-Id: I7e2adaf19d15842f914be6f946f30d09b7b5532f Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Update copyright headersJani Heikkinen2015-02-1627-169/+169
|/ | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I8467410bfad44e8d3fe6bd5724c61bb0c07c91f9 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Sergio Ahumada <sahumada@texla.cl>