Commit Graph

7 Commits

Author SHA1 Message Date
Fabian Kosmale 70a111d05f FileSystemExplorer: Add missing import
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>
2025-07-17 16:11:53 +02:00
Santhosh Kumar 8d3ed392bb Update manual tests and examples for change in default size policy
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>
2024-02-21 14:27:54 +01:00
Dennis Oberst eaaa8647da Filesystem Explorer: Add a minimum width and height
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>
2024-01-16 11:38:39 +01:00
Jakub Wincenciak 3c106a300f Fix issue in File System explorer example with about popup text wrap
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>
2023-10-25 11:21:52 +02:00
Dennis Oberst 959f88e4b5 Filesystem Explorer Example: Introduce version 2
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>
2023-08-21 14:10:04 +02:00
Alexandru Croitor 32f6cbe9f0 Fix filesystemexplorer example to work in macOS bundles
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>
2023-04-12 09:36:57 +02:00
Dennis Oberst 213e932e13 Add File System Explorer example
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>
2023-02-14 13:32:13 +01:00