Commit Graph

8 Commits

Author SHA1 Message Date
Olivier De Cannière cd94c5283c Thermostat: Revert cyclic dependencies var workaround
The cyclic dependencies issues are gone on dev so we can reintroduce
the proper types for all the scheduleViewRoot properties.

Task-number: QTBUG-138188
Change-Id: Ia5b8a47b6844944c8cb9226b653acfd18c90c2fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2025-08-18 11:42:10 +02:00
Olivier De Cannière 3449efd9c2 Thermostat: Apply unmerged patches and fix warnings/errors
This adds the missing part of the thermostat example. It was created but
never merged on top of the first version of the app. The patches were
added manually due to numerous merge conflicts. These changes add new
functionality but appear to never have been completely finished as logic
and layout errors persist. Fix these and all qmllint and runtime errors.

-Implement some missing logic
-Fix logic errors
-Fix binding loops
-Fix some minor layout issues
-Make the UI update when we change rooms or dates etc
-Make dependencies explicit, typed, and checked by requiring them
-Remove convoluted or redundant alias structures
-Qualify lookups
-Set ComponentBehavior to Bound where necessary
-Wrap functions in Connections
-Use Layout.X in layouts instead of settings the property directly
-Use strict comparison operators
-Add missing imports
-Use let instead of var in JS scripts
-Use `...` for multiline strings
-Use var properties for scheduleViewRoot to avoid cyclic dependencies on
 6.10

Task-number: QTBUG-138188
Fixes: QTBUG-117368
Pick-to: 6.10
Initial-patch-by: Kamil Hajdukiewicz <kaj@spyro-soft.com>
Change-Id: I9e5f268105a57c57b4e8147f6747bcf1e954dc2d
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2025-08-18 10:47:18 +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 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 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
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
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