Commit Graph

18 Commits

Author SHA1 Message Date
Ed Cooke d55134197a Clean up CMake output from wearable example when building qtdeclarative
Remove the two CMake warnings from the CMake output when building
QtDeclarative. The warnings come from a missing optional dependency for
the wearable example.

Pick-to: 6.7 6.8
Change-Id: Id9bf2ccc4d6db2ea44618b2119c69c89e271a870
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2024-10-10 14:45:21 +02:00
Alexandru Croitor a6bd1dc3e0 CMake: Add deployment API to our examples
Projects were modified using the tool at:
https://git.qt.io/alcroito/cmake_refactor

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

The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were
removed, these are not needed anymore because example directory
selection is handled by the qt_internal_add_example calls.

The install(TARGETS) calls were modified according to our
documentation snippets for qt_generate_deploy_qml_app_script.

A qt_generate_deploy_qml_app_script call was added for each
executable target.

Note that the deployment step will be skipped in the CI for now,
because:
- we enable QT_DEPLOY_MINIMAL_EXAMPLES in the CI instructions and thus
  set QT_INTERNAL_SKIP_DEPLOYMENT to true
- standalone examples feature is not yet enabled in the CI, which
  means we continue to build examples in-tree, and deployment is
  disabled for in-tree prefix builds.
A small list of examples to deploy in the CI will be chosen in the
future, to ensure deployment coverage, without slowing down overall CI
times due to all the *deployqt invocations.

Even if deployment is disabled in the CI, the install(TARGETS) calls
for each example will still run, installing into an
'installed_examples' directory, which will not be archived by the CI.

The QtBundleQmlModuleForMacOS and bundle_shared code was removed,
because we can now depend on the MACOS_BUNDLE_POST_BUILD option of the
deployment api, to ensure macOS bundle examples run properly in the
build dir. This works even in prefix in-tree builds, when installation
deployment is disabled.

Finally, for all examples that build additional qml module libraries or
plugins, the libraries / plugins must be installed into the bin dir of
each project, along with a qmldir file.

This is to support running the installed project for platforms that
don't have deployment api yet, like boot2qt / yocto.

If we want to have super clean install / deployment rules in the
future, we won't be able to avoid adding ugly per-platform conditions.
The current status quo is deemed an improvement over what we had
before.

Pick-to: 6.7
Task-number: QTBUG-101340
Task-number: QTBUG-102056
Task-number: QTBUG-102057
Change-Id: I843d934668c25dbcd1abca52495b393579633fc5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-27 18:57:34 +01:00
Frédéric Lefebvre d0dafdbc2a Add pause for the notifications to be properly shown
Add a PauseAnimation so that the notication section is
properly shown. Before it was being hidden immediately after being
shown and was therefore impossible to see.

Pick-to: 6.7 6.7.0
Task-number: QTBUG-123318
Change-Id: I9877a3ac069a74bf370532ea0133fad33a43a2e6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-03-22 17:11:40 +00:00
Lucie Gérard 53295d9102 Correct license for examples files
Example takes precedent over build system file type.
According to QUIP-18 [1], all examples file should be
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: Ie8c2539e7659f53a1fd6b48f99ee883ee9aeb0a7
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-21 10:41:29 +01:00
Matthias Rauter 3e51afcb85 Refactor quickcontrols wearable example
Design: Karolina Bang.

Pick-to: 6.7
Change-Id: I0201bb579d297c6bc02c16ef6a5e4b233ffff5de
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2024-02-01 15:51:37 +00:00
Alexey Edelev d276d025a8 Change the way tests and examples query the qmldir file from QML plugin targets
Use qt6_query_qml_module to get path to qmldir, but not TARGET_FILE_DIR.
This is more accurate way.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-120479
Change-Id: I4b7f7bf3b7f69c15871e400af3e7ae945a9bfdf0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-01-15 21:25:12 +01:00
Wladimir Leuschner 41eb033fa2 Fix resizing in Wearable example
Fixes: QTBUG-118779
Pick-to: 6.6 6.5
Change-Id: I8cc906976eeb390152e3d4ce2bf5493bc8d8f1d9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-11-21 19:28:52 +01:00
Samuli Piippo 425c65a27b Examples: fix Wearable on embedded linux
Build the extra QML modules without separate backend library, so that
they load correctly when deployed to embedded device. Deploy also qmldir
files.

Pick-to: 6.6 6.5
Change-Id: I583798eb7841c8fd0520cfa049eaecbadaf50109
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-09 09:20:08 +02:00
Rami Potinkara 628659f759 Update mobile example categories for Qt 6.6
Add mobile example category tags for the chosen examples.
Add for the ones that work best for both Android and iOS.
Remove from the ones that do not work for both (at least yet).

Added, as verified on Android
-scenegraph openglunderqml
-qtquickcontrols-contactlist
-qtquickcontrols-gallery
-qtquickcontrols-wearable

Removed (for now), as not verified yet on Android
-qtquickcontrols-todolist

Fixes: QTBUG-116780
Pick-to: 6.6
Change-Id: I7f22329ec93dedaa63df34bb55dd67d14ffe5c1d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-09-11 13:22:00 +00:00
Venugopal Shivashankar 2983a38c1d Doc: Add \examplecategory for Qt Quick Controls
Also, changed one of the example pages to a tutorial
page.

Task-number: QTBUG-115297
Pick-to: 6.5 6.6
Change-Id: Ife1b740523039b9287008a1c5243edfc4c1349d1
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-07-21 13:01:41 +02:00
Mitch Curtis 789f39b649 wearable: fix various issues
- Ensure icons are legible when a dark theme is in use in the
  underlying OS. The app's own dark mode setting was unaffected by this.
- Remove trailing space in temperature label.

Fixes: QTBUG-114978
Pick-to: 6.5 6.6
Change-Id: Ic31c70c9fe86f4da6850ed4baf28afc1cbfe1dae
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Elias Hautala <Elias.Hautala@qt.io>
2023-07-12 11:26:21 +08:00
Olivier De Cannière fb64096a25 Fix wearable example on macOS and Windows
- Use add_qml_module_to_macos_app_bundle and copy other things from examples
  like attachedstyleproperties and painteditem in order to get it to work on
  macOS.
- Move qt_standard_project_setup() before qt_add_qml_module() (which is
  called by the three add_subdirectory calls). This is required to avoid
  issues with subdirectories on Windows.

Pick-to: 6.5 6.6
Change-Id: Ie0d859c743d0b8b798238346cc2c738ece362c99
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-07-07 16:32:31 +08:00
Kai Köhne 8f1e6aa0ed Examples: Fix license to Commercial or BSD-3-Clause
Pick-to: 6.5 6.6
Change-Id: Ieb1db96846e02c3b93888ed409af82bfb3567c19
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-06-26 16:23:24 +02:00
Topi Reinio 73a62921d0 Doc: QtQuickControls Wearable example: Fix file quoting
Fix \quotefile path as source files have been moved. Also, add .theme
as a valid extension for example files.

Pick-to: 6.5
Change-Id: Icfcb85fdfb99e86eb97ef6e1b53e4fa5771095a3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2023-06-02 16:31:18 +00:00
Mitch Curtis cd61b622f4 Improve wearable example
- Move all (non-icon) images into one directory for simplicity.
- Add explicit qrc prefix to image paths to make them absolute
  and ensure they're found, fixing some errors.
- Fix "XMLHttpRequest: Using GET on a local file is disabled by
  default" warning by setting QML_XHR_ALLOW_FILE_READ to 1.
- Fix "Parameter "page" is not declared" warning.
- Replace qt6_add_resources with qt_standard_project_setup and
  qt_add_qml_module.
- Remove unnecessary quotes from CMake file paths.
- Replace local settings instance that was accessed via the
  root context through several files with a singleton.
- Make the custom Controls style a proper QML module.
  - Make the settings singleton its own module to avoid cyclic imports.
- Adapt documentation to new paths.
- Some ids (in Main.qml) are unused by QML, but used by the
  documentation, so those are left alone.
- Fix qmake build files after these changes.

Fixes: QTBUG-112618
Pick-to: 6.5
Change-Id: I10f6e1f2013fe35eaf4e1e0f4aaa98e6a1ab9c15
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-05-24 10:29:05 +08:00
Kai Köhne 2e6403f8bf Examples: 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: Ib80f885e9f73fb9ad54b9e9b22cae2318877dc07
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-02 12:12:35 +02:00
Mitch Curtis 8b100bed52 Doc: remove "2" from Qt Quick Controls files
Work on this was already started for the documentation in
1abdfe5d5a.

The CMake target (docs_QuickControls2) probably can't be renamed
until we rename the library, which won't happen until Qt 7.

Task-number: QTBUG-95413
Change-Id: Ied20805a91286436606577c3de39671a447f27dd
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-01 10:26:28 +08:00
Mitch Curtis 4bd87b903b Remove "2" from Qt Quick Controls directories
Qt Quick Controls 2 was named that way because it was a follow-up to
Qt Quick Controls 1.x. Now that Qt Quick Controls 1 is no longer
supported, we don't need to have "2" in the name. Work on this was
already started for the documentation in
1abdfe5d5a.

By doing this renaming a few weeks before feature freeze, it won't
affect the release but still results in as little time possible spent
manually fixing conflicts in cherry-picks from non-LTS releases as a
result of the renaming.

This patch does the following:

- Renames directories.
- Adapts CMakeLists.txt and other files to account for the new paths.

A follow-up patch will handle documentation.

It does not touch library names or other user-facing stuff, as that
will have to be done in Qt 7.

Task-number: QTBUG-95413
Change-Id: I170d8db19033ee71e495ff0c5c1a517a41ed7634
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-12-01 10:26:20 +08:00