This prevents policy warnings in a few cases, and we want people to
opt-in to new policies, so make our examples copy'n'paste friendly.
Pick-to: 6.8
Task-number: QTBUG-126201
Task-number: QTBUG-126468
Change-Id: Iefa666b61c2d2f767da3583f0f6efd8e4a2169e5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
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>
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>
The size policy of item updated as part of task QTBUG-117597. This
patch update existing examples and manual tests that depends on quick
layout to embrace size policy change.
Task-number: QTBUG-117597
Pick-to: 6.7
Change-Id: I68469a3bba3c4d3e5ed4b6eae0fd765b5206efc0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
It was observed that users try to run this example on mobile platforms.
It was never designed for such a usecase and is therefore not supported.
Ref: https://camg.me/qt-mobile-2023/#filesystem
Additionally mention that this is a desktop example in the docs.
Pick-to: 6.6 6.7
Change-Id: I55205e3f2cb3a45aaf18f2a52ea24f54ab8e39bd
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This prevents to reduce the window to a minimum of 1px (default), where
it gets hard to expand the window again. As a drive-by improve the
visualization of highlighted files.
Fixes: QTBUG-119785
Change-Id: Ib4a7f37fa4886589bad4cce534a9d73c352dd4ee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Use the standard keys for zoom and quit.
Pick-to: 6.6
Change-Id: I3659a5a84bc1e46938729710af31c834b8a50ed8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
About popup text item had property 'wrapMode' set to 'wrapAnywhere',
so I replaced it with 'wordWrap'. In addition,
I changed text to be same as in QMessageBox::aboutQt() and wrapped
it inside ScrollView.
Fixes: QTBUG-117969
Pick-to: 6.6
Change-Id: I7a138a4a6bdb592bd3dd8edbeb76042e266b7c6f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
This updated version addresses several bugs and misbehaviors that were
identified in the previous version. I have rewritten and improved
various aspects of the application to provide a more stable and reliable
user experience.
Here are some of the key changes and enhancements in version 2:
- Fix qmllint warnings.
- Reduce the number of redundant items
- Apply the custom window decorations inside MyMenuBar
to the contentItem instead of the background to scale
properly.
- Fix additional scaling and UI misbehaviors
- Add an application icon
- Add an editor with line numbers
- Add command line options to specify an initial directory
- Since rootIndex is exposed inside TreeView since 6.6
this is an excellent opportunity to make use of it
- Crosslink the python version of this example in the docs
Pick-to: 6.6
Change-Id: Ib816a95f843b3f4b84b11db893facda0ffc6f482
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The FileSystemModule qmldir was explicitly put into the "/" resource
prefix, but that prefix is not a default qml import path. That caused
the qml module not to be found when building on macOS as an app
bundle, which relies only on resources and not the file system to find
the module.
To ensure the module qmldir is found in the resources, we want it to
be placed in the default qml import path ':/qt/qml'. To do that,
remove the previously specified RESOURCE_PREFIX option and enable
the QTP0001 policy by requiring Qt 6.5+, which will put the module
qmldir into :/qt/qml/FileSystemModule/qmldir.
Because the policy also changes the resource prefix for other
resources (images), adjust all Image source urls to be relative paths
(relative to the component), instead of absolute paths.
Also adjust the qmake generated qrc file to place the files into the
new resource prefix.
Amends 213e932e13
Fixes: QTBUG-112683
Change-Id: I5205cf6d399a6faaf7cce68d55c71dade37479a7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@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: I673207be9dd73a010069828b92146c37e45e9143
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This example shows the customization of Qt Quick Controls by
implementing a simple file system explorer. Using a C++ model, entries
are visualized in a TreeView, and text files can be read.
Fixes: QTBUG-108289
Change-Id: I966dcf65e40d3b727889dc14c65edd0ffcc1b878
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>