summaryrefslogtreecommitdiff
path: root/src/controls/TreeView.qml
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-02-19 16:50:26 +0100
committerCaroline Chao <caroline.chao@theqtcompany.com>2015-02-25 07:57:02 +0000
commit5df76111772749e8c1dc323e1300607e0e2c427b (patch)
tree6bf4e910aa36d5e975bbf697c5510abe0697186b /src/controls/TreeView.qml
parentcdd0c1d5ac5daf8010e8088ca80e059dbea66efc (diff)
downloadqtquickcontrols-5df76111772749e8c1dc323e1300607e0e2c427b.tar.gz
TreeView: Always update selection current index
This gets us closer to the classic item views behavior. Change-Id: I1f9ccdaa1c91e807a8726715a520dd0006c6e988 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls/TreeView.qml')
-rw-r--r--src/controls/TreeView.qml5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/controls/TreeView.qml b/src/controls/TreeView.qml
index 2d158954..8aaf3bbf 100644
--- a/src/controls/TreeView.qml
+++ b/src/controls/TreeView.qml
@@ -329,13 +329,14 @@ BasicTableView {
if (selectionMode) {
var modelIndex = modelAdaptor.mapRowToModelIndex(row)
+ selection.setCurrentIndex(modelIndex, ItemSelectionModel.NoUpdate)
if (selectionMode === SelectionMode.SingleSelection) {
- selection.setCurrentIndex(modelIndex, ItemSelectionModel.NoUpdate)
+ selection.select(modelIndex, ItemSelectionModel.ClearAndSelect)
} else {
var itemSelection = clickedRow === row ? modelIndex
: modelAdaptor.selectionForRowRange(clickedRow, row)
if (selectionMode === SelectionMode.MultiSelection
- || modifiers & Qt.ControlModifier) {
+ || selectionMode === SelectionMode.ExtendedSelection && modifiers & Qt.ControlModifier) {
if (drag)
selection.select(itemSelection, ItemSelectionModel.ToggleCurrent)
else