Commit Graph

33 Commits

Author SHA1 Message Date
Olivier De Cannière 05104e501d Thermostat: Enforce qmllint warnings
The PropertyChanges warnings have to be disabled to keep supporting QDS
compatibility.

Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: I727f58be7de6e94749a65f5cfca47ea032a7a5ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 11:10:38 +02:00
Olivier De Cannière 447db272f1 Thermostat: Use strict comparison operators
Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: I3a40b23c7b7ec82ba3809df5af2ea459819c1053
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 11:10:36 +02:00
Olivier De Cannière d20caffc81 Thermostat: Remove unused imports
Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: I9a4b108d1655006f0bd0dd2bb69142b86442b7c8
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 11:10:34 +02:00
Olivier De Cannière 94c88d46c5 Thermostat: Adapt to new model and general cleanup
The RoomsModel has changed in shape in the previous commit. This commit
adapts the rest of the app to it and performs general cleanup and
warning fixing.

-Remove dead code
-Qualify lookups
-Declare all properties injected into delegates as required and give
 them a proper type such as Room or list<Room> instead of var
-General dataflow and depencies fixing. Change aliases to required
 properties where required
-Make the min/max/avg temperature values in the stats view update
 dynamically
-Simplify logic for processing temperature, humidity, and energy
 statistics

Change-Id: I21d962e9d692578f00c4e2466aae8a40d12a7dcc
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2025-08-07 11:10:32 +02:00
Olivier De Cannière 147f78d7de Thermostat: Update RoomsModel
Change the model from a ListModel to a list<Room> where Room is a new
type containing all the information related to a room. This allows
making what is passed to various components and delegates clearer and
explicit.

The data of the model itself was also updated:
-The statistics for humidity, energy, and temperature for each room are
 now stored as simple list<int> or list<real>.
-Data series were regenerated to be more varied; many were identical or
 didn't fluctuate enough to visibly change dynamically in the UI.
-More rooms were made active from the start and especially the first one
 which allows for immediate interaction in the thermostat settings view
 without having to first activate the room.
-Background values for humidity and energy consumption were also made
 more varied instead of identical everywhere.

The rest of the example will be adapted to this new model in the next
commits.

Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: I3ce48ccb14aa4cfdee2d0508427b26598ce5446a
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 11:10:30 +02:00
Olivier De Cannière 093cf9cbf4 Thermostat: Set ComponentBehavior to Bound where necessary
Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: I9997ebf3e6ca8336b3fefc34a51d53237a401c5f
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 11:10:28 +02:00
Olivier De Cannière a5c5e09ab8 Thermostat: Replace Color.blend with custom rgbBlend
The Color singleton isn't exposed publicly yet and there is no way of
importing it without using an internal module. This generates runtime
warnings. Borrow the logic in a new function specific to the example.

Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: Iea5ecfc7276d79be4f60318953ef0468c6123e63
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2025-08-07 11:10:26 +02:00
Olivier De Cannière 97b4a68494 Thermostat: Wrap signal handlers in Connections
Raw functions and function calls are not allowed in .ui.qml files.

Most .qml files in the proejct are empty. Respect the trend by sometimes
moving functions inside the .ui.qml files.

Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: I95db0ba473189183fa46ddba3b7eb1ce938e5326
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2025-08-07 11:10:23 +02:00
Olivier De Cannière 913aca0b95 Thermostat: Use preferred{With,Height} inside Layouts
Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: Ifff8fab0d60211390570726c648d17f4c2a58bed
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 09:07:19 +02:00
Olivier De Cannière 4e73f07849 Thermostat: Declare dependencies of the ThermostatContent module
This helps resolve ApplicationSettings and Constants which are used all
over.

Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: I6b0beaba914f8400336ab3def8542f8520a46535
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 09:07:17 +02:00
Olivier De Cannière e462f2121e Thermostat: Fix qmllint warnings in the Thermostat module
Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: Icd26c71541106cc3a554aa8e62ecf240062f64b7
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 09:07:16 +02:00
Olivier De Cannière 30dc679c9a Thermostat: Use QtQuickControls.Basic
The example uses custom controls for its UI so we can safely use a
a style that the compiler can deal with.

Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: I66bcad7a78e06ab9d3e28b4ba238fec42dd9c81b
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 09:07:14 +02:00
Olivier De Cannière 8324d68486 Thermostat: Clean up some CMake code
Make module dependencies explicit.

Task-number: QTBUG-138188
Pick-to: 6.10
Change-Id: I82f06e7195ba0f07ac66eed7f891146393ab8fb9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2025-08-07 09:07:12 +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
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
Leena Miettinen e3239a8f18 Doc: Fix links to Qt Creator documentation
- Link to topics in Qt Creator 14.0
- Use the macro \QC
- Remove obsolete links
- Remove \externalpage commands to use links from qtbase

Change-Id: I41f6300a5464c8a46ba6c5d0e15a7fbb2164392c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-08-09 13:41:54 +00:00
Mikko Gronoff 1e1f20747d thermostat: update energy consumption unit
kWh instead of KM/H.

Pick-to: 6.7
Change-Id: I97d8f73af902b11315f58ee190144bedb002b913
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-28 09:13:26 +03: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
Chris Lerner 44c9b5162f Correct a typo in Thermostat example
Pick-to: 6.7 6.6 6.5
Change-Id: Ifcfb7005fb95ad7851e701fd7cbb287f4341f086
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-04 10:06:30 +00:00
Lucie Gérard 0b0ba1bc42 Correct license for documentation files
According to QUIP-18 [1], all documentation files should be
LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

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

Pick-to: 6.7 6.7.0
Task-number: QTBUG-121787
Change-Id: Idbbd9c9bc1780cf97c71398a3b118d5b371b0ca3
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-19 09:56:22 +01:00
Kai Köhne 9a61a3a987 Demos: Add dependency info to example metadata
Add metadata about build time / runtime dependencies in the form
of Qt documentation modules. This should allow Qt Creator to hide
examples where needed Qt modules are not installed (because they
are optional in the Qt Online Installer).

Pick-to: 6.7
Task-number: QTBUG-120759
Change-Id: I03d8d75b273fe497803b9af9783b90e397b0638d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-19 10:26:22 +01:00
Wladimir Leuschner 0bb20e154c Decrease rounding radius/transparency in Thermostat Example SmallLayout
Fixes: QTBUG-119290
Pick-to: 6.6 6.5
Change-Id: I9fcad3e6c234e82993e68688828383ba4a1a9ed6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-23 20:18:41 +00:00
Wladimir Leuschner acf8f0a418 Hide Settings Tab for SmallLayout/Portrait in Thermostat Example
Settings Tab and Theme Change Icon have the same functionality.
This patch removes the Settings Tab, when the Theme Change
Button is visible on the top right.

Fixes: QTBUG-119294
Pick-to: 6.6 6.5
Change-Id: I079d2c7a597111716391e21ebb46dbd1d908abc3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-23 21:18:41 +01:00
Wladimir Leuschner 26742b74aa Fix Thermostat Swipe Rooms View in Thermostat example
Thermostat room view is going to the first item, when end of rooms list
is reached and the user wants to go to the next room. Analogous, the
user is sent to the last room when selecting the previous room while
being in the first room.

Fixes: QTBUG-119320
Pick-to: 6.6 6.5
Change-Id: If8c18c40ba903ba1b670f122676da6e0eff6c08e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-23 21:18:41 +01:00
Wladimir Leuschner 88a884904c Fix room icon binding in Thermostat Control page in Thermostat example
Fixes: QTBUG-119297
Pick-to: 6.6 6.5
Change-Id: Ibdc9edfa237decc2754379d4f4b7d6acc34941af
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-23 21:18:41 +01:00
Wladimir Leuschner abc8baa05f Fix typos in Thermostat example
Fixes: QTBUG-119286
Pick-to: 6.6 6.5
Change-Id: I6af6fc849aa40e025b059f601cc833625bca4212
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-23 21:18:41 +01:00
Kai Köhne 7132a75c18 Add 'Coffee Machine', 'Thermostat' example to Embedded category
They are good application examples, but also work well for showing
how to use Qt for embedded use cases. So let's have it in both.

Pick-to: 6.5 6.6
Task-number: QTBUG-117210
Change-Id: I8edbd82c5c8f8f7b804a0fec4743ec3b3c05cf07
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-10-26 09:13:46 +00:00
Kai Köhne 0183fa1a97 Build FX_Material_Showroom example again
Revert removal of the example from the default built that was done in
3f9c25bdb7 8941da8b40. Use different names for the clashing CMake
targets.

Pick-to: 6.5 6.6
Change-Id: Ife9b796fa416091505acfd9b5f59cc4ea6ab93f9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-08-22 12:27:35 +02:00
Friedemann Kleint 17e7109f01 Examples: Use consistent organization names and settings paths
Set the organization name to "QtProject".
Set an application name to Hangman to be used by QSettings.
Remove unused QSettings instance from Thermostat.
Let QSettings in Document Viewer use defaults.

Pick-to: 6.6
Change-Id: I8ebaeb444cd18bab95424f0efea670b02d41e657
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-07-04 13:43:26 +00:00
Axel Spoerl fcfcd657f5 thermostat demo: Fix icon path
When the path for CustomControls was changed into
ThermostatCustomControls, the icon paths in qt_attribution.json were
not adapted.

This patch updaes it.

Task-number: QTBUG-114759
Pick-to: 6.5.2 6.5 6.6
Change-Id: I8ec1ea85612f4a70d6baa99223e15a6c12ae4891
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
2023-06-22 08:06:43 +02:00
Kamil Hajdukiewicz 8ce518b898 Rename CustomControls module in thermostat example
The name of the module is changed from CustomControls to
ThermostatCustomControls due build errors.

Fixes: QTBUG-114759
Pick-to: 6.5.2 6.5 6.6
Change-Id: I86cf9830700b867a4a690d0f41841417bfa1efc1
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: <kaj@spyro-soft.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-06-21 12:02:47 +02:00
Kai Köhne 1ac93ad9ca Thermostat, TODO List: Remove unused QDS components
The QDS components are built by default, which generates a lot of
warnings by qmlsc, and also creates issues on Windows due to
too long paths. But they are not used, so we might as well remove
them from the examples.

Pick-to: 6.5.2 6.5 6.6
Change-Id: Ie932b05c88f07793a95e4980cb4f63aa0a58229e
Reviewed-by: <kaj@spyro-soft.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-06-21 12:02:46 +02:00
Kamil Hajdukiewicz 3f9c25bdb7 Revamp Thermostat example 2
The new responsive design of Thermostat Example is implemented.
The application is prepared to look good on desktop, mobile and small displays.

In the current state only part of the application is prepared.
Schedule View is not ready.

What is done:
1. Rooms View
2. Thermostat Control View
3. Statistics View
4. Dark/Light mode

Pick-to: 6.5.2 6.5 6.6
Change-Id: I52d07b7001b1f78025d74ab827e58b5d23b2dedb
Reviewed-by: <kaj@spyro-soft.com>
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2023-06-20 12:48:37 +02:00