Commit Graph

18 Commits

Author SHA1 Message Date
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
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
Mitch Curtis 8f705f0db9 gallery: fix RadioDelegates not being exclusive
The ButtonGroup was being declared several times rather than once.

Amends b663020c9a.

Fixes: QTBUG-122454
Pick-to: 6.5 6.6 6.7
Change-Id: If66f5a5a6841a56abbf93908c83facc9970def40
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-02-21 21:27:53 +08:00
Wladimir Leuschner 5e8a49c797 Fix spelling error in QtQuick Gallery example
Fixes: QTBUG-118760
Change-Id: I6bc0164f04c76ba9004032007559cbfd1a87724f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-14 15:30:14 +01:00
Kai Köhne dac7706e61 Doc: Move some examples to User Interface Components category
Pick-to: 6.5 6.6
Task-number: QTBUG-117243
Change-Id: Id13a0d8e02e6fea7ae84dbee524d60fe2f3ad3b7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-10-24 08:24:34 +02:00
Santhosh Kumar 3c633dc1e0 Fix delegate loading issue in gallery example
The delegate component in DelegatePage.qml uses properties from
the context where loader exists. This behavior of Loader seems to
be changed and it doesn't forward properties. Thus, property
reference through required properties doesn't work in the component
that's getting loaded, with ComponentBehavior configured as Bound.

This patch makes a workaround by moving the component within Loader
scope and access model properties through its id.

Fixes: QTBUG-117062
Pick-to: 6.6 6.5
Change-Id: Ib1f21f842f9926a426fb79f2fbb2536ed53f98d8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-09-20 08:10:03 +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
Santhosh Kumar afb57dfa06 Docs: Update documentation about orientation mode in the gallery example
The gallery example depends on two factor to determine its orientation.
Apart from size of the window, the orientation configuration in the
setting (introduced in the patchset
7c7e3a1fdf) would also be considered.

This patchset updates documentation for the change mentioned above.

Pick-to: 6.6 6.5
Change-Id: Iaf46c5cc49350e889121b3e57dc3f86e46609459
Reviewed-by: Juho Lääkkö <juho.laakko@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-08-15 17:48:43 +02: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 53144f16c6 gallery: fix some QML compiler warnings
Not all compiler warnings can be fixed, because the example
supports multiple styles through one executable, and hence
cannot use compile-time style selection. Document this.

Fixes: QTBUG-110827
Pick-to: 6.5 6.6
Change-Id: I80a92890d427967ff21d4f457c373e75a937195f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-07-12 11:25:37 +08:00
Santhosh Kumar 7c7e3a1fdf Add explicit option for landscape mode in gallery example
The patch set 730c1d1630 adds support for
landscape mode in gallery example. But this causes glitch when window
resizes dynamically (as in this scenario, the virtual keyboard shows up
and it dynamically resizes window).

This patch adds an option in settings to enable landscape mode only
when required and disabled by default.

Fixes: QTBUG-114693
Pick-to: 6.5 6.6
Change-Id: I64cd4d48ade10a4f43615663a0b7aef3e13a2895
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-07-10 13:07:04 +02: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
Friedemann Kleint a841da2c75 Gallery/Text editor: Update example logos
Pick-to: 6.5
Change-Id: I552edf074958be3af8c72042e65c6586308f434f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-03-27 08:22:16 +01:00
Oliver Eftevaag ef7c39ecf5 Gallery example: translate all user facing strings
This patch wraps user facing strings inside qsTr()

Task-number: QTBUG-110989
Pick-to: 6.5
Change-Id: I3c5220ba7b552101c006d10c4c86efe8c2b8843c
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-03-16 16:21:34 +01:00
Santhosh Kumar 730c1d1630 Improve gallery example
* Fix qmllint warnings
  * Added support for landscape mode
  * Updated docs

Fixes: QTBUG-110989
Pick-to: 6.5
Change-Id: Id7422ad19b4336c64c866309dd07116d982ecff2
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-03-07 10:24:50 +01:00
Ulf Hermann 2d44365f69 CMake: Allow omitting the version of QML modules
Also, drop all the VERSION 1.0 lines from the examples and tests. 1.0 is
actually a bad default version since it's before all the Qt versions.

[ChangeLog][QML] You can now omit the VERSION argument to
qt_add_qml_module(). This will automatically generate the highest
possible version.

Pick-to: 6.5
Task-number: QTBUG-99146
Change-Id: Ic10ec69b87c224e0e94e1785f65653815d4c778c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-01-27 19:16:39 +01: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