Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.9.4, 5.10.1
-
None
Description
There is an issue on TableView and TreeView QML components whenever we define programmatically the current selection and then change the extended selection using the Shift modifier.
Once we change the current selection (using for example TableView.currentRow and TableView.selection.select) the previousRow of TableView/TreeView is not affected. The issue is then noticeable when we extend the selection by using RightClick and ShiftModifier. The result is that the extended selection starts from a row that is not the newly selected one (because internally, previousRow is used to note the start of extended selections with Shift).
If we start from a clean state (TableView/TreeView without selection), and we force by code the selection to be row 2 and then we extend the selection to row 5 (holding Shift) the resulting selection should be 2, 3, 4, 5. Obtained result is 0, 1, 2, 3, 4, 5.
A common example of functionality broken by this behavior is a right click on a line to provide a set of actions, that first selects the line and then display a contextual menu about it.
Please have a look at the attached project to reproduce easily with TableView.