Selection of item in QListView when selected using Mouse
I have a QListView which contains QStandardItemModel which displays thumbnails.
When I select the items using Mouse, mouseMoveEvent is called followed by selectionChanged.
The selection scenarions are mentioned below -
Assume the numbers(1,2,3....) to be the items
Scenario 1 - In case thumbnail display is 2 horizontal rows.
Lets assume they are displayed as above, then the item selection is in the below order
whereas the expected selection is
Scenario 2- In case thumbnail display is in 3 horizontal rows.
  
  
  
Lets assume they are displayed as above, then the item selection is in below order
where as the expected selection is 1,2,3,4,5,6,7,8,9,10,11
Can anyone please suggest a way to get the listview item selection as expected?
I have tried by changing the selectionBehavior and selectionMode too. Currently the selectionBehavior id ExtendedSelection.
Are you selecting your thumbnails from left to right and up to bottom ?
The result appears to be the same when I select either from left to right or top to bottom.
Looking at the selectedIndexes documentation I would say that you will have to do the sorting yourself
I tried using qsort... It worked..:)
Thank you ....
You're welcome !
Don't forget to update the thread's title prepending solved so other forum users may know a solution has been found :)