summaryrefslogtreecommitdiff
path: root/src/controls/TreeView.qml
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-231-20/+20
| | | | | | | | | | | This reverts commit 345343b7830cd9ccf03ccbe435cdaee13ba8d0fc. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: Ib1f8762037141b0c9fca42a8e1b9e1bf4585a110 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Update commercial license headersTarja Sundqvist2021-02-021-20/+20
| | | | | | | | | | | | | | | | Updated header.COMM to the files in tqtc-qtquickcontrols. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4215 Change-Id: Id7a83ea4b83801352f9d45eaa688777add6784ab Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
* TreeView: update currentIndex on model changesAlberto Mardegan2020-03-101-1/+7
| | | | | | | | | | | The previous binding was not getting re-evaluated when the model was being reset or when rows were been inserted or removed. Here we use a counter variable, whose value change will force the evaluation of the binding. Fixes: QTBUG-53097 Change-Id: I76afebbda78ab477cf65631337a8bad51ca5428d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* TreeView: allow selecting items by touchShawn Rutledge2017-12-271-4/+18
| | | | | | | | | | | | | | | | Only single items can be selected via an actual touchscreen, because the keyboard modifiers are not accessible in a mouse event synthesized from touch. With a mouse, if the system has a touchscreen, then selections done by consecutive clicking (with or without modifiers) will work, whereas dragging across a consecutive range will not work because dragging is the same as flicking. But on systems which do not have a touchscreen at all, the behavior is the same as before. Task-number: QTBUG-47243 Change-Id: Ib0fa1a75592b982fe93da46f0c2e3018219947d0 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-071-0/+2
|\ | | | | | | Change-Id: Ieeccd9670bca7dd354ae78de49b5e179973a9d4c
| * StyleData "selected" should be false on invalid rowsFilippo Cucchetto2016-03-041-0/+2
| | | | | | | | | | | | | | | | | | | | When a row is -1 the __mouseArea.selected(row) function should return false. Without this change the styleData.selected property could be true with invalid rows. See BasicTableView.qml:555 where "itemSelected: __mouseArea.selected(rowIndex)" Change-Id: I535782446b4afb17f560bca75ec8c17b65f1bafe Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-161-8/+26
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/dialogs/qquickabstractfiledialog.cpp src/dialogs/qquickfiledialog.cpp Change-Id: I60aab7c7e819f82f82fc30f473b36a7a57d9a91a
| * TreeView should update selection on release with ExtendedSelectionFilippo Cucchetto2016-02-121-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | The selection shouldn't change on press if multiple items are selected and the user presses on an already selected item. This is the correct behavior on Windows and OSX where selection changes on release. Furthermore reacting on press prevents the end user to implement dragging. In fact if we react on press the selection changes before the dragging event starts. Change-Id: Iff5bca8efa5f0701c479f63ff8b1f442268a98d5 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Unify license header usageAntti Kokko2016-02-041-12/+15
|/ | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I3c851bc24da89f6300b94199387d1adf16ca4f48 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* TreeView: Add rootIndex propertyGabriel de Dietrich2015-07-271-0/+1
| | | | | | | | | | | | | | | Its purpose is the same as QAbstractItemView::rootIndex and allows to display only the part of the model data that is descendant of this index. The filesystembrowser example has been updated to only show files reachable from the user's home directory. [ChangeLog][TreeView] Added rootIndex property Change-Id: Ib8d9af4ce9d1f341ab509de3cc991773830ba9f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* TreeView: Track model indexes during selectionGabriel de Dietrich2015-07-041-25/+33
| | | | | | | | | | | | | | | | | | | | As we keep track of the previous user-selected row, it can happen that that row is no longer part of the TreeModelAdaptor items if the user collapses it or any of its ancestors (collapsing a node doesn't update the current selection). This will result on the row index pointing to the wrong entry in the model (or a completely invalid one). Instead, we now track the selection with QModelIndexes making it more robust to branch expansion and collapse in the view. We'll still need to account for model changes which means that, in the future, we should invalidate the previous user-selected item. Change-Id: I54ba2582e65515eef95d5f8ad755a8c68568d7ad Task-number: QTBUG-46891 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* TreeView: Check that indexes belong to the current modelGabriel de Dietrich2015-05-221-2/+12
| | | | | | | | | | | | | And warn the user about it. We omit printing anything else in case we would be holding an invalid reference to some model. Internally, we assert if, despite the guards, we still get the wrong model indexes. Change-Id: I8e7451375d19c2aa406257a9b0193d59f69b0355 Task-number: QTBUG-46214 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* TableView, TreeView: Refactor documentationGabriel de Dietrich2015-04-161-194/+0
| | | | | | | | | | | The problematic property is itemDelegate which has different properties attached in both cases. But it seems we can't over- ride a property documentation blob unless we use .qdoc files. We also update TreeViewStyle documentation. Change-Id: Ie358e17767f67737b9fbf8ef96d8e646063fdca9 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* TreeView: Add indexAt() functionGabriel de Dietrich2015-04-161-0/+14
| | | | | | | Change-Id: I6a8105d074fd71d9d0dff35d07ba1622093e1d4b Task-number: QTBUG-45351 Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* TreeView: Add styleData.index property for itemDelegateGabriel de Dietrich2015-03-301-0/+1
| | | | | | | | | This gives access to the QModelIndex pointing to the current row in the model. Change-Id: I2fcd69e023575754edd196758a8c3ddc32f47717 Task-number: QTBUG-45187 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* Doc: Fix qtdoc warningsCaroline Chao2015-03-061-3/+3
| | | | | | | | | Mostly link errors and missing documentation. And removed useless references to {QtQuick.Controls.Styles} in the doc. Change-Id: Iad211a574c0bd23c84e067e0cbcc18c3e719cde7 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Merge Extras' styling system into Controls'.Mitch Curtis2015-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Removes the duplicated style settings functionality in Extras and simplifies the installed styles directory structure. - Extras' Base style is now part of Controls' Base style, eliminating the need for a separate QtQuick.Extras.Styles import. The cost of doing this should be negligible: a few QML files and two images. If we didn't merge Extras' Baste style into Controls', we'd need extras-specific code in qquickcontrolssettings, as the default style search path is: qml/QtQuick/Controls/Styles/ Whereas the Extras Base style would be in: qml/QtQuick/Extras/Styles/ The Extras Base style can't go into Controls' Base style directory, either, because otherwise we'd have two qmldir files there. The Flat style doesn't have this problem because it is all contained in one plugin and gets installed into its own Flat/ folder. - Documentation now lists the Extras controls as \since QtQuick.Extras 1.4. - Adds the customcontrolsstyle auto test to ensure that custom styling is tested. Change-Id: I19ca7a8b7e1c1daa85b272f4ccf9a2f05c76e0d9 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* TreeView: Always update selection current indexGabriel de Dietrich2015-02-251-2/+3
| | | | | | | This gets us closer to the classic item views behavior. Change-Id: I1f9ccdaa1c91e807a8726715a520dd0006c6e988 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix LGPL3 license headerSergio Ahumada2015-02-171-6/+14
| | | | | Change-Id: I1288f3b73f72c24bd3c4fa199dd7ee92629bd4d6 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* BasicTableView: Refactor and specialize ItemDelegateLoaderGabriel de Dietrich2015-02-131-0/+6
| | | | | Change-Id: If95725e428025000d65984c81a1d7e1bac78e484 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* Introducing TreeViewGabriel de Dietrich2015-02-131-0/+523
The TreeView, as currently implemented, extends the TableView by adding support for hierarchical models. In the broad sense, it remains a list view with columns, like TableView. The main architecture is based on TreeModelAdaptor, that wraps the hierarchical model. It keeps track of which items are expanded or collapsed, and also relays model changes to the view. (TreeModelAdaptor is a private type and should be considered as an implementation detail.) The TreeView only supports QAbstractItemModels for the time being, and, just like TableView, relies on roles to pass the data to the view. This also means that model columns are not supported. Selection is supported by ItemSelectionModel which exposes part of the API of QItemSelectionModel. For this, support has been added for QModelIndex and related classes. This requires importing QtQml.Models 2.2 should an actual usage of the TreeView use selection. In the same way, TreeViewStyle currently extends TableViewStyle with the relevant features, like branch indicator. [ChangeLog][QtQuick.Controls] Introducing TreeView With-Help-From: Caroline Chao <caroline.chao@theqtcompany.com> Change-Id: Id3dba240a732744571e4a646b7b98678ab522da6 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>