aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/filesystemexplorer/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Correct license for examples filesLucie Gérard2024-04-041-1/+1
| | | | | | | | | | | | | | | 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.0 Task-number: QTBUG-121787 Change-Id: Ie8c2539e7659f53a1fd6b48f99ee883ee9aeb0a7 Reviewed-by: Kai Köhne <kai.koehne@qt.io> (cherry picked from commit 53295d9102632568ba3ea817d009f30317b9761a) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Add deployment API to our examplesAlexandru Croitor2024-03-281-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. 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> (cherry picked from commit a6bd1dc3e0c3dc118b281afbc60d9de3aefc48fa) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Filesystem Explorer: Guard against mobile usageDennis Oberst2024-01-221-0/+5
| | | | | | | | | | | | | | | 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 Change-Id: I55205e3f2cb3a45aaf18f2a52ea24f54ab8e39bd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 9e4f24e7491ebd8e26a7ca4d56046e558b57154c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Filesystem Explorer Example: Introduce version 2Dennis Oberst2023-08-211-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix filesystemexplorer example to work in macOS bundlesAlexandru Croitor2023-04-121-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 213e932e138d460159487a624838aa7d3bcffb4a 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>
* Add File System Explorer exampleDennis Oberst2023-02-141-0/+74
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>