Summary: | Selection is wrong when using mouse, keyboard and shift-Arrow | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Simon <simon.eu> |
Component: | general | Assignee: | Peter Penz <peter.penz19> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | finex, frank78ac |
Priority: | NOR | ||
Version: | 16.12.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Simon
2009-07-25 14:52:32 UTC
Thanks for the bug report! I can reproduce this and agree that this is not the expected behaviour. That should most likely be fixed in Qt - I think it's somewhat related to, but not exactly a duplicate of, bug 163451. Maybe I'll try to come up with a fix and submit this to Qt Software when I find some time. It seems that this is not a Qt issue after all - the simple patch below appears to fix it for me. @Peter: was there a reason to use selectionModel()->select(...) to select the current item and not QAbstractItemView::setCurrentIndex(...), or is it OK to commit this patch? Only QAbstractItemView::setCurrentIndex updates QAbstractItemViewPrivate's pressedPosition member, which points to the item which is the starting point for the next Shift-selection. BTW, I don't really understand at the moment why this sort of keyboard selection is handled differently in QTreeView and QListView, but there's probably a reason for that... Index: src/dolphindetailsview.cpp =================================================================== --- src/dolphindetailsview.cpp (revision 1021034) +++ src/dolphindetailsview.cpp (working copy) @@ -421,7 +421,7 @@ // Stay consistent with QListView: When changing the current index by key presses, // also change the selection. if (m_keyPressed) { - selectionModel()->select(current, QItemSelectionModel::ClearAndSelect); + setCurrentIndex(current); } } @Frank: Not using selectionModel()->select(...) might be a relict when we tried different versions of the autoscroller, I'm not sure... I currently have no time for coding + testing the patch, but I'd say please commit the patch as setCurrentIndex() is the obvious choice. Thanks! I've just tried the patch. I've tried to work a bit and to some test and I've see no side effects. SVN commit 1021267 by freininghaus: Fix selection in the Details view in the following use case: 1. Ctrl-click item 1. 2. Enter the first letter of item 2, such that it will be selected and the new current item. 3. Shift-click item 3. With this commit, all items between 2 and 3 will be selected, as expected, and not all items between 1 and 3. BUG: 201459 M +1 -1 dolphindetailsview.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1021267 SVN commit 1021269 by freininghaus: Fix selection in the Details view in the following use case: 1. Ctrl-click item 1. 2. Enter the first letter of item 2, such that it will be selected and the new current item. 3. Shift-click item 3. With this commit, all items between 2 and 3 will be selected, as expected, and not all items between 1 and 3. Fix will be in KDE 4.3.1. CCBUG: 201459 M +1 -1 dolphindetailsview.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1021269 Thank you! (In reply to comment #6) > Fix will be in KDE 4.3.1. Sorry, that was 4.3.2, of course ;-) |