Use Synchronizer to synchronize different coffee
slider values with CoffeeConfig.
Set sugarAmount to 0 by default.
Change docs to reflect new implementation.
Fixes the synchronization issue with sugar value.
Pick-to: 6.10
Fixes: QTBUG-138676
Change-Id: Ic73066df3ab2a4281aaf885547f22d2a3bdf662d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
We can't have cyclic dependencies between types in 6.10.
To reduce the cyclic dependency, we are extracting the coffee settings
into their own type.
The next commit will then (targeting only 6.10) replace ApplicationFlow
properties with var properies.
Reducing the coupling further by extracting the navigation functions
into yet another type is left as a future exercise.
Also, note the opportunity to fix the PropertyChanges in Progress.qml to
not reference a non-local id (which now wouldn't work anymore) – that
wasn't caught by qmllint because PropertyChanges is custom parsed, and
the only way to avoid this is to use the new syntax – but the warning
for that has been turned off due to QDS compatabililty.
Task-number: QTBUG-138898
Change-Id: I6ae97a567350c98dcd8056ac8433858b0b8aec6f
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
(cherry picked from commit 5b075084fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We're at the point where we can enforce 0 warnings, if we decide to
explicitly ignore the custom parser one (which we need to ignore at
least for the ui.qml files).
Running the all_qmllint target will now fail the build if a new warning
is introduced (but the target is currently not run by default).
Pick-to: 6.10
Change-Id: I60a232dc838574701c0f5a9db9245ff0f8f24525
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Move the orientation value into its own singleton; it's not directly
coffee related, and we want to make use of it in many places, including
ui files, where we don't really want to have a dependency
ApplicationForm (so that they can be still be opened in QDS).
Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: Ib60fe29e814af2e564a33239ba36afd0d7bf9537
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
It's generally recommended over using load with some weird looking qrc
path.
Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: Ibe68c35f810d8f7339efaa6185dfb1a9ed36f1eb
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Avoid coupling CustomToolBar to ApplicationFlow. Instead, give
CustomToolBar its own signals, and emit them when the buttons are
clicked.
Add the signal handling logic to ApplicationFlow.
Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: I96c98750f99cb4529bf47dd27a22a55bcecfa20f
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Both "light" and "dark" were plain QtObjects, who happened to have the
same additional properties. Instead, declare the properties once in an
inline component, and use it as the type instead of "var".
Pick-to: 6.10
Task-number: QTBUG-138164
Change-Id: Icb9f2cad2c05aa256ea0e6d5bde47e5a0a7f6923
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
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>
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>
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>
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>
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>
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>
This patch
-enables qmltooling in non release builds
-this will allow QML debugging to start and work
-this patch will do this to following examples:
-calqlatr, coffee machine and dice
Task-number: QTBUG-136794
Pick-to: 6.9 6.8
Change-Id: I4699285fa20021ec9d6e29c86a7a16516af085fa
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Setting this to 35 is not going to work properly as edge-to-edge is not
working properly yet in Qt for Android 15.
See https://developer.android.com/develop/ui/views/layout/edge-to-edge
Fixes: QTBUG-132360
Pick-to: 6.9 6.8
Change-Id: I46020d07e3aea59d57ebf1bef1b25f1f90971827
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Also, fix few grammar and spelling in the UI.
Pick-to: 6.8
Task-number: QTBUG-124675
Change-Id: Ib04d6ccaeecfa9a8d1a8b02742132f29c42c64d4
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
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>
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>
Removed Cup.qml from Coffee Machine example. The file was not supposed
to be there after the example re-design as it is supposed to be
replaced by the Cup.ui.qml but apparently it was not fully removed and
was left in the file listing of coffeemachine.qrc.
With Cmake the file has not been visible in Qt Creator or Squish
but with qmake its visible in Qt Creator
and exposed to Squish as well.
Affects testing the example because the same object has different
object names in Squish between Cmake and qmake.
Task-number: QTBUG-123440
Pick-to: 6.7 6.7.1
Change-Id: I82c2a315cd8af9459e5d5caecb3a3efe8a1e5eff
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Jani Korteniemi <jani.korteniemi@qt.io>
Coffee Machine example gives warnings about UI component recursive
rearrengements on Settings, Insert and Ready pages when orientation
changes.
Tracked issue to originate from the coffee cup image Rectangle
container trying to resize its width based on its height.
Removed the width to height bindings.
Task-number: QTBUG-123445
Pick-to: 6.7 6.7.1
Change-Id: Idd4ee13bc2446608a2f8d5d472370c120b4d05b7
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Coffee Machine coffee cup image is broken with Qt 6.7.0 for unknown
reasons, more descriptive explanation in the linked bug ticket.
Modified the broken dark_cup.svgz image to expose the hidden
parts of the image.
Before Qt 6.7, Qt only supported SVG Tiny 1.2 standard. From Qt 6.7, we added some of the most used features in SVG 1.1. The file in this example uses <filter> element which was not support before, and since it was not supported it was never parsed. In Qt 6.7, this <filter> element is parsed. However, we only support a subset of the filter primitives that can be used inside the <filter> element, and since this file uses an unsupported filter primitive <feBlend>, it causes an issue.
Simply removing the reference to the <filter> element from the Svg file, fixes the issue.
Fixes: QTBUG-124707
Pick-to: 6.7 6.7.1
Change-Id: I62391fa4fc320f440045958e0ef0dc2eef69d21c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Fix the issue with the Coffee Machine example application window
filling the whole virtual desktop screen space, which is wrong.
Set initial application window size to some hardcoded values which
will be used on desktop. On mobile platforms the window size will
be maximized.
Update docs to reflect this change.
Fixes: QTBUG-123414
Pick-to: 6.7
Change-Id: If8323c0c1ada4aa5230aa94cf624b2a0ff859b5e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
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>
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>
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>
Renamed QML module and .qrc file in Coffee Machine example, because
using same name for application and QML module causes errors.
Fixes: QTBUG-120230
Change-Id: Iacb73681df83236cf01e3bae75da748de4cf4875
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reason for these changes is that it was discovered that some of the
UI elements of the re-designed Coffee Machine example did overflow the
target device display with lower than ~1080x1920 display resolution.
Added states to coffee cards that will scale the cards and their content
down if target device screen resolution is lower than set limit.
Added state to home component where text components will be scaled
down in target device screen resolution is lower than set limit.
Added some colors to Colors.qml to remove hardcoded color values.
Added states to sliders in Settings.qml and in CustomSlider.qml
that will scale them down if target device screen resolution is
lower than set limit.
Scaled the custom buttons heights down a bit throughout the
app to make them fit on screen.
Added state to progress page that will scale the caption text
down if target device screen resotion is lower than set limit
and set minimum width and height to dialog component so that
the text will not overflow its container.
Added states to ready page that will reduce the row spacing of the
grid component and scale the caption font size down if target device
screen resolution is lower than the set limit.
Tested successfully with Android emulators with screen resolution
ranging from 320x480 to 1440x3120.
Removed multiple property changes regarding text sizes in
Settings.qml and replaced them by binding the text objects
font size to a new property int that will be modified through state.
Added the missing when condition in state change to change
the font size in Setting.qml.
Renamed ambiguous id's
* Removed unused property aliases
* Re-applied missing qdoc snippet tags to Settings.qml which were removed
by mistake. This should fix one of the qdoc warnings in CI.
Fixes: QTBUG-116402
Pick-to: 6.7 6.6
Change-Id: I2524be43f943494f5ab7b2689b222a977996dac6
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
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>
The font file was removed already in commit b40aaf48ca, along
with the qt_attribution.json file, so we should also remove
the font license file.
Note that the font is still referenced in some .qml files,
but we don't ship it anymore.
Change-Id: If67f0f9ecd5ef3b3a86ab610d2e36b0ce307d8f6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
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>
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>
The bug was due to the fact that when the coffee was finished brewing,
the state was being set to "initial" which was unnecessary.
So I decided to remove this part of code, which solved the bug.
Task-number: QTBUG-114375
Pick-to: 6.5 6.6
Change-Id: I7c8cbc96330574f0378ea8d1ee3ac2a4732f70e3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Removing usused imports
* Removing versions from imports
* The state property is a string
Change-Id: I2a7c8de17c414a20984830b964f9386f92a2cb00
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Prefer unversioned commands over qt6_ ones - even though the
target-based qt_add_resources command is actually new in Qt 6.
But we will evolve the API also between major Qt versions,
so it's better to work with the Qt policies mechanism instead
of relying on version numbers in the command API.
Pick-to: 6.5
Change-Id: If302abb1f22a7ab96c98a8ad2e9c871b9bedb0e9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
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>
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>
Mark Coffee, Calcqlatr, Photo Surface as part of the
Applications category, which we want to prominently
feature in the next generation of QtC's example screen.
While at it, also simplify the names.
Pick-to: 6.5 6.5.0
Task-number: QTBUG-108751
Change-Id: I34e7a2b3aad0db9cb2e79f683bce19554dc4002d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Only the coffee machine example had some tags already. Add them
also for the rest, but inside the .qdoc file, instead of the
more clunky/verbose tagging in the .qdocconf file.
Pick-to: 6.4
Change-Id: I37640c2296c67413361f7987122c5e7daa1f12b0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
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>
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: I9499ba4c20f610ffe8af0fc3e29e6581247f2c40
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
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>