Commit Graph

16 Commits

Author SHA1 Message Date
Joerg Bornemann 4f57e20f25 CMake: Don't enable ASM language
Remove the ASM language where no assembler files are used.

Pick-to: 6.5 6.8 6.9
Change-Id: I3c94f798803b054a432fc2c8d6d65c665572a202
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-05-02 16:02:32 +02:00
Richard Moe Gustavsen 8212fe7827 TreeViewDelegate: hasChildren should be bool, not int
The documentation and the manual test declares 'hasChildren'
as 'int'. It should be 'bool'.

Pick-to: 6.9 6.8
Change-Id: Ied8c66f3758e759b5803cf0e08135555644747b8
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2025-01-09 19:20:40 +01:00
Lucie Gérard 9c5fc88388 Correct license for test files
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-02-27 10:32:21 +01:00
Shawn Rutledge 9316d0b642 Test QFileSystemModel with no icon provider
Task-number: QTBUG-99178
Change-Id: If96c07d173f676f5e88e1500e05b7fc2ca49e4c4
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-02 01:09:14 -07:00
Richard Moe Gustavsen 94175c12de manual test, treeview: add a SelectionRectangle
Add a SelectionRectangle to the manual test, so that
it's possible to test mouse selections on a treeview.

Change-Id: Id8d224af4b243b3598aaa06ed81a4420314cfe7e
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-01-09 10:40:49 +01:00
Richard Moe Gustavsen f940f1b87e TreeView: add support for setting a root index
This patch will let you set a root index in TreeView.
This can be used to only show a branch of the tree model.

[ChangeLog][Quick][TreeView] You can now set a rootIndex
in TreeView, to only show a branch of the tree model.

Fixes: QTBUG-108541
Change-Id: I1f51d01e0353eeae5d1b08400cb95b306d49f1a3
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-05-24 09:40:40 +02:00
Richard Moe Gustavsen 8333954f7e QQQuickTreeView: double expand from TreeView, not TreeViewDelegate
We should ideally implement as much mouse logic as
possible outside the delegate. This will make it
easier to implement custom delegates, since you would
then only have to care about the visuals, and not the
mouse logic.

Therefore, move the doubleTap-to-toggle-expanded
logic out of TreeViewDelegate, and into TreeView, for
all custom delegates to enjoy.

Change-Id: I01f49252d35fed033f162d7bab47478abefe73d1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-12-09 11:38:54 +01:00
Richard Moe Gustavsen 21bf976a41 QQuickTreeViewDelegate: implement edit delegates
This patch will implement a default edit delegate
for the TreeViewDelegates, for all our styles.

[ChangeLog][Controls] TreeViewDelegate got support
for editing nodes in the tree.

Change-Id: Iec5936e4439770586837daa3b8045482b75a15f2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-08 23:33:42 +01:00
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Alexandru Croitor a8431a4067 CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I1cd769f85d5f82c43639d6787d98e536619249e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 14:58:42 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Richard Moe Gustavsen c013439598 QQuickTreeView: add expandToIndex()
Add a function that lets you expand the tree recursively
from an index in the model, and all the way up to the root.

[ChangeLog][QtQuick] New function "expandToIndex()"
has been added to TreeView.

Change-Id: I063ef698e37f44730438e1638d3b7c1b4edaa0d0
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-02-18 00:09:53 +01:00
Richard Moe Gustavsen 2014101583 TreeViewDelegate: allow app to add custom pointer handlers
As it stood, it was not possible to add custom pointer handlers
to a TreeViewDelegate, to e.g do an expandRecursive() if using the
right mouse button, or holding down ctrl during a click.

This patch will change this, so that we only perform the default
collapse/expand operations when using a plain left (double)
click, and ignore the event otherwise.

Pick-to: 6.3
Change-Id: Ifbdf0903158b65c50d0e36e98ab7e48efaa3e3ab
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-02-10 10:09:11 +01:00
Richard Moe Gustavsen 0ddb0d4b9b controls: add TreeViewDelegate
This patch adds TreeViewDelegate to Controls.
TreeViewDelegate is a ready-made delegate that can be
assigned to TreeView. It takes care of drawing the
tree using the style, and can be used directly
without the need for customization.

It implements all the required properties set
by TreeView, and offers in addition a small API that
lets the developer change the indicator and the label.

[ChangeLog][Controls] New delegate added: TreeViewDelegate

Change-Id: I50fbc059afbc2b896d23d9d59717c8571e94bae6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-12-09 23:16:37 +01:00
Richard Moe Gustavsen 18da655b77 quick: add qquicktreeview
This patch adds TreeView to Qt Quick. It is more or less
a copy from the TreeView in Marketplace, but with some
modifications to make it more equal to the already
existing TableView, ListView, and GridView.

[ChangeLog][Item Views] A new view is added: TreeView

Fixes: QTBUG-61630
Change-Id: Ibb9d22cf9c9df021e77d03287872134c2682682a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-04 23:41:45 +01:00