Hi there,
I'm trying to programmatically select a number of rows in a QTreeView showing the contents of a custom QStandardItemModel.
Qt Code:
QItemSelection selectedItems; selectedItems.select(topIndex, bottomIndex);To copy to clipboard, switch view to plain text mode
When the topIndex (May 01) and bottomIndex (May 02) rows have the same parent, it works well.
However, if the bottomIndex (May 02) doesn't have the same parent as the topIndex (April 30), no items are selected:+ May
|-- 01 // selected
|-- 02 // selected
Is this a limitation of QItemSelection::select method? Or am I misusing it?+ April
|-- ...
|-- 30
+ May
|-- 01
|-- 02
I was wondering if this should be done manually, by selecting individual ranges in each branch and merging them after.
Thank you for your answer!
Best,
j
Bookmarks