Commit Graph

15 Commits

Author SHA1 Message Date
Fabian Kosmale e9f81a985e coffee example: Clean up dataflow (5/n)
Set the state depending on applicationFlow in ChoosingCoffeeForm in
ChoosingCoffee instead, where it is guaranteed to be available.

Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: I2104adab719e44f5151e504daa9260b39d1ef2e3
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-07-18 10:04:08 +02:00
Fabian Kosmale daf3f87430 coffee example: Clean up dataflow (4/n)
Deal with Home. Home differs from the other pages, because it is used as
the initial item, and thus an actual instance is already created in the
ui.qml file, not only a Component.
As we still want to use a required property referencing the
ApplicationFlow instance, the instantiation is moved into
ApplicationFlow (instead of ApplicationFlowForm).

Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: I903352e17560c056fdb12e370ee5413adbe2fd1d
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-07-18 10:04:04 +02:00
Fabian Kosmale 1c77d5ec77 coffee example: Clean up dataflow (3/n)
Apply the common pattern to the remaining sub-pages, besides Home.

Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: Ic79547d04b97285981afb206ba2db79309c629fd
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-07-18 10:04:01 +02:00
Fabian Kosmale d2bb2585f2 coffee example: Clean up dataflow (2/n)
Make the dependency on AppicationFlow explicit in Progress by using a
required property. Use that to move the binding to ApplicationFlow's
properties into Progress itself, instead of setting them up in the
"progress" component – this reduces the dependency of
ApplicationFlowForm on its derived type. Initialize the required
property when pushing the component on the StackView.

As a drive-by, use the more modern pushItem function instead of push.

Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: I9e483c97b7585cef2fed043aa3a5ab35a4b54b10
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-07-18 10:03:57 +02:00
Fabian Kosmale 12b2da0621 coffee example: Clean up dataflow (1/n)
Make the dependency on AppicationFlow explicit in Settings by using a
required property. Use that to move the binding to ApplicationFlow's
properties into settings itself, instead of setting them up in the
"settings" component – this reduces the dependency of
ApplicationFlowForm on its derived type. Initialize the required
property when pushing the component on the StackView.

As a drive-by, use the more modern pushItem function instead of push.

Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: I47f2931d57ccd66c47775923a15e23d371afa6d1
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-07-18 10:03:54 +02:00
Konsta Alajärvi c2586fe191 Examples: Remove unused imports in coffee example
Remove unused imports in coffee example.

Task-number: QTBUG-123315
Pick-to: 6.8
Change-Id: Ia79a86e35ccb86e1c70fad3f0e5c6e0d1fb88519
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-08-23 09:10:55 +03:00
Konsta Alajärvi 2821519ef2 Examples: Fix coffee example imports
Coffee example gives run time issues on Windows and macOS due to
QtQuick.Controls import that imports styles not customizable on
windows and macOS.

Change imports to QtQuick.Controls.Basic so the same style is imported
on every environment.

Task-number: QTBUG-123315
Pick-to: 6.8
Change-Id: I8f67b87a1fa16d0c8156a05ab065de95aaf363de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-08-23 08:18:17 +03:00
Konsta Alajärvi 0cac392e36 Separate UI from business logic on re-designed Coffee Machine example
Added .ui.qml counterpart files for components that needed separation
between the UI and business logic.

Rebased to dev to get the newest changes

Added Cup snippet tags to ProgressForm.ui.qml

Added AbstractButton snippet tags to CoffeeCardForm.ui.qml

Fix ambiguous id's and corresponding property aliases in CoffeeCardForm.ui.qml

Added qdoc snippet tags to ChoosingCoffeeForm.ui.qml

Fixed incorrect file paths in snippet tags in coffee.qdoc

Moved transitions from ProgressForm.ui.qml to Progress.qml
as they did not work properly from there to make the coffee cup
animation work properly.

Added property alias "contentItem" to ProgressForm.ui.qml
to access it's properties from Progress.qml to make the progress bar
animation work properly.

Fixed x coordinates in custom sliders so that the slider handle
will not go over the slider bar and become unresponsive.

Removed "brewTime" property int from ProgressForm.ui.qml as it was
not needed there.

* Fixed x coordinate in Sliders to work like they are described
in official documentation.

* Created property int in Progress.qml to better describe cup animation
velocity factor.

Fixes: QTBUG-120280
Pick-to: 6.6 6.7
Change-Id: I3ed0e1c6777674e2d9502aab1e5c670b6099f60a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-02-08 10:18:18 +02:00
Nicholas Bennett f167a114ea Docs: Coffee Machine application example app documentation update
Added material under Adapting to different screens.

Added section Navigating through the app pages.

Added material to Implementing start page and
Implementing Coffee selection sections.

Added code snippets that will replace the precviously used
\quotefromfile.

Added material to cover the rest of the code.

Added snippet identifiers to source code.

Removed trailing whitespaces.

* Fixed grammatical issues.

Fixes: QTBUG-116406
Pick-to: 6.6 6.7
Change-Id: I30c4d8a3f7a159d03df70b960059c11472f942bb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2023-12-18 06:26:05 +00:00
Konsta Alajärvi b40aaf48ca Re-design for Coffee Machine example
Implementing new design for Coffee Machine example, more information
on how the new design is going to look like in QTBUG-116402 and in
its subtasks.

Removed unused imports folder.

Changed the names of Home.ui.qml to Home.qml and FilledCup.qml to
Cup.qml in Coffee.qrc file.

Changed the names of the files stated above also in qmldir.

Fixes: QTBUG-116403
Fixes: QTBUG-116402
Task-number: QTBUG-116404
Change-Id: Ib4d33e28ce1e3f268172007e85f36eb1280d11a4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-24 11:42:21 +02:00
Thomas Hartmann 910e28a7f1 Fix qmllint issues in coffee demo
* Removing usused imports
* Removing versions from imports
* The state property is a string

Change-Id: I2a7c8de17c414a20984830b964f9386f92a2cb00
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-06-19 17:47:33 +00:00
Thomas Hartmann 7d09e80d53 Fix Coffee machine demo
By using a constant/binding we avoid that the binding for the settings
state is deleted as a side effect of having a Behavior.

This fixes the demo, but not the underlying issue.

Task-number: QTBUG-106677
Pick-to: 6.4
Change-Id: Ic4c5da9f159cb242fd4d3f039286bc0a3bdb803f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-09-30 09:55:25 +00:00
Lucie Gérard 6f57506953 Use SPDX license identifiers
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: Idfd176b7f7b077a5b7c66b7738dc9bcac94ab290
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-07 18:23:52 +02:00
Venugopal Shivashankar 70ce5f4d3e Move demos to qtdoc repository
These demos use several modules and moving them allows to use for
example Qt Quick Controls 2 in them.

The shared directory should be removed and the examples made
self-contained.

Change-Id: I5dc667d22388651894d7d145b65752bc5c5cf6cf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-07-09 12:43:59 +00:00
Nico Vertriest d6686a578d Doc: Move coffeemachine examples to examples/demos
-Also add license file for TitilliumWeb-Regular.ttf
-Add qt_qttribution.json and LICENSE.txt

Task-number: QTBUG-68357
Change-Id: I705a28ed9f113e7ad3cca1b93eb162cc223d9d2d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-06-07 11:07:19 +00:00