aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/filesystemexplorer
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Revise File System Explorer exampleAndreas Eliasson2025-10-291-45/+47
| | | | | | | | | | | | * Re-arrange and add section headers to adhere to the app template. * Replace first-person plural (we) with either third-person singular (the example) or second-person singular (you). * Add qdoc links to C++ or QML entities. Fixes: QTBUG-137898 Pick-to: 6.10 6.9 6.8 Change-Id: Ib61ca9beac1bafb4e4e5f8fcc6475093b313768e Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
* Examples: Stop using version numbers with QML modulesSze Howe Koh2025-10-281-1/+0
| | | | | | | | | | | | | | | | | | | | | Continues 2d44365f69b9bc946d085c6b149e2ac319700265 and b7f448f8647a9a118cee2d79d446194b20d4b335 * Qt 6.0 enabled and encouraged users to import QML modules without specifying a version number * Qt 6.5 enabled and encouraged users to create QML modules without specifying a version number With this approach, there is little benefit in specifying QT_QML_SOURCE_VERSIONS, especially in an example module that is not consumed by external software. It does not need to worry about compatibility/versioning. Task-number: QTBUG-89033 Task-number: QTBUG-140406 Change-Id: I7f83dc7430180b79b70c75e7ce7b3aef46a028ae Pick-to: 6.10 6.8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* filesystemexplorer: Provide proper metadata for macOSKai Köhne2025-08-013-9/+20
| | | | | | | | | | | | While at it, also remove hardcoded application version in main.cpp: Qt can retrieve this from the application metdata. Also use camel-case for the project name, according to https://contribute.qt-project.org/quips/13 Pick-to: 6.10 Change-Id: If73fd741e330b66ae5367a61c65ccc65653cdab6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* FileSystemExplorer: Add missing importFabian Kosmale2025-07-171-0/+1
| | | | | | | | | | | | | | When running on the example, qmllint would complain that it doesn't know about Qt.RightEdge (and BottomEdge). The reason for that is that the global Qt namespace is only exposed by the global Qt object from builtins. Controls doesn't actually expose that one, so we need to import QtQml (QML would work, too, but that's mostly internal). Pick-to: 6.10 Fixes: QTBUG-138171 Change-Id: I28004e1d36ae6d07a1a01a72ecf716b17ca5b9ec Reviewed-by: Dennis Oberst <dennis.oberst@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* examples: Consistently require Qt 6.8Fabian Kosmale2024-07-031-1/+1
| | | | | | | | | | | | 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>
* CMake: Add deployment API to our examplesAlexandru Croitor2024-03-271-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. 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>
* Correct license for examples filesLucie Gérard2024-03-212-2/+2
| | | | | | | | | | | | | 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>
* Update manual tests and examples for change in default size policySanthosh Kumar2024-02-212-0/+3
| | | | | | | | | | | 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>
* Filesystem Explorer: Guard against mobile usageDennis Oberst2024-01-223-2/+11
| | | | | | | | | | | | | 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>
* Filesystem Explorer: Add a minimum width and heightDennis Oberst2024-01-162-3/+14
| | | | | | | | | | 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>
* File system explorer example: Improve shortcutsFriedemann Kleint2023-11-011-2/+3
| | | | | | | | Use the standard keys for zoom and quit. Pick-to: 6.6 Change-Id: I3659a5a84bc1e46938729710af31c834b8a50ed8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix issue in File System explorer example with about popup text wrapJakub Wincenciak2023-10-251-24/+48
| | | | | | | | | | | | | 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>
* Filesystem Explorer Example: Introduce version 2Dennis Oberst2023-08-2122-434/+882
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-126-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Doc: Use the \examplecategory macro to tag examplesTopi Reinio2023-04-111-1/+1
| | | | | | | | | | | | | | | | 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>
* File System Explorer example: Make QMimeDatabase a static variableFriedemann Kleint2023-02-221-3/+3
| | | | | | | | | | | QMimeDatabase is potentially expensive to initialize, avoid doing this repetitively. Amends 213e932e138d460159487a624838aa7d3bcffb4a. Task-number: QTBUG-108289 Change-Id: I66e5aeb22ffade9b86635e27b9d518c9e40aee4f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add File System Explorer exampleDennis Oberst2023-02-1427-0/+1367
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>