summaryrefslogtreecommitdiff
path: root/tests/auto/qquicktreemodeladaptor
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-271-0/+51
|\ | | | | | | | | | | | | Conflicts: tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp Change-Id: I0b6018fdac65a5385136e4c3561fba1c52ecd32e
| * Fix moving of TreeView itemsJoni Poikelin2016-08-261-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Property binding for row property in styleData causes an update which tries to read new value for the index property, but index is changed afterwards which causes old value to be read. This may lead to crashes and other unwanted behavior. Depth changes are now delivered to update item depths in visible items and model index changes though role instead of looking for a row change. Task-number: QTBUG-47523 Change-Id: I540cd06a25281f18e4628f4b030cf969dc8e0a7f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Controls: append "1" to all C++ classesMitch Curtis2016-03-181-33/+33
| | | | | | | | | | | | | | | | | | | | This is consistent with the classes that have already had this done. It prevents clashes with Qt Quick Controls 2. These classes are not available to the user, so it doesn't affect compatibility. Change-Id: Iee73ee6bc530182732ae95993e1f4fc3766eb8e0 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | Unify license header usageAntti Kokko2016-02-041-18/+10
|/ | | | | | | | Updated license headers to use new GPL-EXCEPT header instead of LGPL3 one (in those files which will be under GPL 3 with exceptions) Change-Id: I2b4c7522e5ec10dc7e9422886a20802d53929f30 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* TreeView: Add rootIndex propertyGabriel de Dietrich2015-07-271-5/+42
| | | | | | | | | | | | | | | 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-9/+26
| | | | | | | | | | | | | | | | | | | | 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>
* TreeModelAdaptor: Monitor model's lifespanGabriel de Dietrich2015-05-211-0/+19
| | | | | | | | | | | We make the model adaptor behave as if it had no model set if the model gets deleted. Also, while not strictly necessary, using a QPointer adds some extra safety. Change-Id: Ic6963319678acee0097dcddfea36059f9046b093 Task-number: QTBUG-46214 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* TreeModelAdaptor: Take into account childless expanded itemsGabriel de Dietrich2015-04-161-0/+125
| | | | | | | | | | | | | | When removing or moving items, we may call lastChildIndex() with an invalid index because we're not checking for childless items which can be expanded (think about expanding an empty directory). Same thing when relayouting an item. The solution requires testing for the actual children count since hasChildren() count return true even when the item has no children. Change-Id: I0fa6de41e20c6cb2433f8846449e9f1a2989ce91 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix TreeView missing visualization of expander image on insert or removeFilippo Cucchetto2015-04-141-0/+62
| | | | | | | | | | | | The current implementation doesn't emit the datachanged signal on the hasChildren role during insertion or remove of rows. This could cause the missing visualization of the expander images in the view. This happen when a new row is inserted inside a leaf node or when a previously not leaf node becomes a leaf because its last child has been removed. Change-Id: I4145cb6bd58fe2efeb38c5c14f10657d956fc6ed Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Introducing TreeViewGabriel de Dietrich2015-02-132-0/+1147
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>