Unsolved ItemSelectionModel from QML
I am trying to use
ItemSelectionModelto manage selections in a
ListView-based component I am working on.
I have got basic functionality working with single selection. So if I select with no modifiers, a single item is selected, and if I select with Control modifier, the single selection is added to any existing selection.
I now want to get range selection working (with Shift modifier).
I believe I need to call the overload of
ItemSelectionModel.selectthat accepts a
QItemSelection. However I do not know how to construct a
QItemSelectionfrom QML. I found this documentation that suggests
QItemSelectionis exposed to QML as a vector of
QItemSelectionRangeand that the latter is exposed as a 'value type' to QML. But how do I actually construct one??
I guess no-one else has tried to use this?