Commit Graph

30 Commits

Author SHA1 Message Date
Fabian Kosmale 78dc366da6 colorpalettteclient: Fix qmllint warnings
Most of the warnings were straightforward to fix: add missing ids to
lookups, remove an unused import.

There is one interesting case, though: The getCurrentUserImage function
in ColorView was referring "users", which does not exist in that file,
and is not one of its properties. The application however still worked.
That's due to it being found on the root context, as it exists as an id
defined in Main.qml.
It was however already passed down via properties to ColorView, so use
the property instead.
Amends 7a62659880

Pick-to: 6.10
Change-Id: I6f91dc45302f30d70d8a09b66d0add9b963fa6b2
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2025-08-11 17:48:16 +02:00
Kai Köhne 1bc8cba0e2 Example: Use actual example name for project()
The project name is used in Qt Creator as root name for the project.
Using the same name as the documentation/example name makes it
clearer which example is actually open. Only drop prefixes like
'Qt Quick Demo - '.

Pick-to: 6.10
Change-Id: I863a23e26307a973bb04ce879d0c95c3731cdc53
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-07-09 08:58:58 +02:00
Kai Köhne b9c0da70a6 Remove 'Qt Quick Demo - RESTful API client' from App Examples category
Pick-to: 6.10
Task-number: QTBUG-137988
Change-Id: Iaf8e52c42d5829bac86e4374bd83be6c69b33d18
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2025-06-24 10:37:59 +02:00
Juha Vuolle 01a5299453 Add api-key hearer to colorpaletteclient example
Colorpaletteclient is able to interface two server backends: public
reqres.in service and QHttpServer example service. The public reqres.in
service has recently started requiring an api-key HTTP header (see
https://reqres.in/signup).

This commit adds an api-key header if the app uses the public
reqres.in service. The header is added to the QNetworkRequestFactory
and is consequently then used in all subsequent requests.

The code is furthermore  adjusted so that it won't accidentally
remove the api-key when toggling another proprietary header ("token").

Pick-to: 6.9 6.8
Fixes: QTBUG-136790
Change-Id: Id19d223722fd8f735d76855a293bc77f680ed344
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-05-19 11:05:18 +03:00
Matthias Rauter 9f91454fe6 Adjust delegate width to fit the URL in colorpalette
The server URLs got an additional /API path and they didn't fit into the
delegates anymore. This patch increases the delegate width so it looks
nice again. This is not the best solution. A dynamic solution would be
better but also a bit too complicated for an example.

Amends 6a6212a652.

Pick-to: 6.9 6.8
Change-Id: Iead827d4e37b5e0494f7f35c95934b8bf848cb40
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2025-04-17 23:28:08 +02:00
Juha Vuolle 19040296e4 Include qrestaccessmanager.h with QtNetwork prefix
Use include style that is consistent with rest of the
application. The include style was a leftover from the times the
application itself defined "restaccessmanager.h". Since Qt 6.7
the qrestaccessmanager.h is a proper QtNetwork class header.

Pick-to: 6.9 6.8
Change-Id: I25c1103ed9ccef1aa1da86475a1e20d9dba76a3b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2025-04-17 07:41:33 +03:00
Juha Vuolle 3ab7b6eb02 Link colorpaletteclient example against Qt::Network
The application uses QtNetwork classes and should link against it
accordingly. This missing linkage doesn't cause problems for most
users because QtNetwork is usually transitively linked through other
modules.

But understandably relying on transitive linkage is not acceptable.
This became a problem when disabling QML networking
(-no-feature-qml-network) => Qt::Network classes no longer available.

Pick-to: 6.9 6.8 6.5
Fixes: QTBUG-136036
Change-Id: Id2f1348551f77c5139b514bce95d97f8c8e38f67
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2025-04-17 07:41:30 +03:00
Lucie Gérard c91bd3ae52 Add REUSE.toml files and missing licenses
REUSE.toml files are read by reuse to complement or override the
copyright and licensing information found in file.

The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.

In order to be reuse compliant all the licenses referenced in file
or within a REUSE.toml file must be present in the LICENSES
directory at the base of the module.
The missing licenses are added.

Also, all the licenses present in the LICENSES directory must be used.
License files not used are removed.

[1]: https://reuse.software/spec-3.2/

Task-number: QTBUG-124453
Task-number: QTBUG-125211
Pick-to: 6.8
Change-Id: I1dabbf6f13c2ae5ad73dc8c7df9108c160e1dc2b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-11-06 13:48:01 +01:00
Fabian Kosmale 5b2e51a533 colorpaletteclient demo: Opt in to QTP0004
This avoids a warning about using the old policy bheaviour, and allows
us to remove redundand own-module imports.

The qmake project needs no further adjustment, as it already collapses
the folder structure in the qrc file system.

Pick-to: 6.8
Task-number: QTBUG-126201
Change-Id: I1804611c6158775346d2f652537ae48664e5a267
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-07-22 09:25:29 +02:00
Alexandru Croitor cde9cfb96c CMake: Add deployment API to our examples
Projects were modified using the tool at:
https://git.qt.io/alcroito/cmake_refactor

Some examples had to be adapted manually, mostly those that build
additional qml modules / plugins.

documentviewer did not get the deployment api, because it's trickier.

Pick-to: 6.7
Task-number: QTBUG-101340
Task-number: QTBUG-102056
Task-number: QTBUG-102057
Change-Id: I76322185fc824c112d77e077ee39e7ccbc193a4c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-05-13 09:44:04 +02:00
Kai Köhne 07dfdfac03 Examples: Remove shared resources from examples
Fixes: QTBUG-123472
Change-Id: Id45b966cfc3405718a99441e3e0c4f0d17e601c9
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-03-20 13:29:48 +01:00
Lucie Gérard 8b36425fab Correct build system file license under example
According to QUIP-18 [1] all files under examples
should be licensed
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7 6.7.0
Task-number: QTBUG-121787
Change-Id: Ia2e8f62af64a384196a9b0c02ac5b2fbf5404a8b
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-19 08:20:16 +01:00
Juha Vuolle 1be090be7d Remove obsoleted QIcon code from colorpaletteclient
The recently refactored UI doesn't rely on icon theming anymore.

Amends: 7a62659880

Pick-to: 6.7
Change-Id: I59bc7df167cf6cbd6b26cbd494674927f81f319e
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2024-03-07 13:45:35 +02:00
Friedemann Kleint 70af90d85b color palette example: Fix errors in Python port
The Python port uses different models, which causes QML errors like

ColorPalette/ColorView.qml:296:17: TypeError: Cannot read property 'width' of null

when refreshing the model. Specify ids instead of "parent" in the
delegates since their parent can arbitrarily change.

Amends 7a62659880

Task-number: QTBUG-115085
Pick-to: 6.7
Change-Id: Ic7097496ad2d8b902225ea0e5c3a661f797aed16
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2024-02-22 12:05:13 +01:00
Matthias Rauter c75b665d8a Indicate SSL support in the colorpalette UI
Ammends 7a62659880

Pick-to: 6.7
Change-Id: I9b51af41f752ae5da826ae1c98ae7cb2bf20b3aa
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-02-19 10:10:37 +01:00
Juha Vuolle 02885ea89d Fix type related space character usage in colorpaletteclient example
Change '* ' into ' *', and '& ' into ' &'

Pick-to: 6.7
Change-Id: I29223b069d92f67195405fa88795469a6cc767a0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-14 14:05:52 +02:00
Juha Vuolle 6a6212a652 Change colorpaletteclient demo to use REST helpers
Pick-to: 6.7
Fixes: QTBUG-114649
Change-Id: I26723e51951bf8285c0bcc30ff3bc6f4970c1e8b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-14 14:05:42 +02:00
Juha Vuolle 5f69e07142 Address QTP0002 CMake policy warning in colorpaletteclient example
Happens on Android builds

Task-number: QTBUG-115085
Change-Id: Ib8abdf297d5bac5d8bc01b9480f328f569ecc36b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-07 11:10:48 +02:00
Juha Vuolle ad5c428718 Make colorpalette's qtexamplestyle qml module accessible on macOS
... by making sure it's properly part of the app bundle.

Task-number: QTBUG-115085
Change-Id: I196d309c9400acb897950dbfb5fe99d9d7f13756
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-02-07 11:10:43 +02:00
Matthias Rauter 7a62659880 Refactor GUI for color palette example
Task-number: QTBUG-115085
Change-Id: I35f9e7a26b929353a25bc2959350b161bed5e59b
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-02-07 08:12:43 +00:00
Mate Barany 555425d71b Rename Qt Quick Demo - RESTful Color API client example
...to improve visibility for search engines.

Pick-to: 6.6 6.5
Task-number: QTBUG-114713
Change-Id: Ie9d3dbbdd802c8dbfcd28fe25d794b53ee32533f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-10-25 14:25:25 +02:00
Kai Köhne 5f6a5f87be Doc: Hide attributions for example icons from overview
The code is only used in an example.

Fixes: QTBUG-116580
Pick-to: 6.5 6.6
Change-Id: I9a045d128a8f36e442ab38dd2fee0d84b31511e2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-08-30 12:48:04 +02:00
Kai Köhne e1220042e6 Doc: Add more examples to Application Examples category
Add following examples to Application Examples category:

* Robot Arm Example
* Qt Quick Demo - RESTful Color Palette API client
* Media Player Example
* Document Viewer

Pick-to: 6.5 6.6
Change-Id: Ie36bb9a09d7fe868db07e02edcb1778f214494e9
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-06-15 11:07:40 +02:00
Juha Vuolle 06bd16a47c Add REQUIRES parameter to qt_standard_project_setup
Pick-to: 6.6 6.5
Change-Id: I8c72fa5f2e113dc4fd8cc6d69495f7cec7c327f3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-09 11:19:28 +03:00
Kai Köhne 835f15cfbb Use versioned CMake targets for Qt modules
Use e.g. Qt6::Core instead of Qt::Core. This is better matching the
find_package(Qt6 ...) call, and also avoids issues that the versionless
targets have.

Pick-to: 6.5
Task-number: QTBUG-113277
Change-Id: I9bc7963d8524ef2ab061e32aef428711646247a7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-05-02 12:03:42 +00:00
Axel Spoerl ba61af0bf3 Migrate documentviewer example into plugin based architecture
This patch changes the document viewer example to a plugin based
architecture.
It adapts the documentation accordingly.

Change-Id: Ia24028aa27e21fb8ab36f5ef3a9953be60858b19
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-05-02 10:11:06 +02:00
Topi Reinio b597ecb954 Doc: Use the \examplecategory macro to tag examples
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: I8590894bdd31d69c38a60cdd42f7301e2cecd2ed
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-04-12 12:51:59 +00:00
Amir Masoud Abdol 67aac2075a Replace AUTO_RESOURCE_PREFIX with REQUIRES
Pick-to: 6.5
Change-Id: Id6a371d8afcca65e0f1e010f4a681c4e5673e1ba
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-06 11:32:55 +02:00
Andreas Eliasson 18253f28f0 Doc: Fix broken links
Pick-to: 6.5
Change-Id: Ie6154f91649282e7a6d5efc4636d7c21399a8bd5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-03-03 15:49:37 +01:00
Juha Vuolle 80f9a83d90 Colorpalette HTTP REST client example
Replace the addressbook client example with a colorpalette client.
The corresponding addressbook server has been superseded by a
colorpalette server.

The client can interface the local QHttpServer colorpaletteserver
example as well as the publicly accessible reqres.in. Please note
that the reqres.in is stateless service, and eg. adding/updating colors
will have no actual effect.

Task-number: QTBUG-106041
Pick-to: 6.5
Change-Id: I4ea06bbcd9b32900a661f19e0abe0629275aaef1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-02-14 11:57:19 +02:00