How to select a range with ItemSelectionModel?
-
The docs for
ItemSelectionModelsay you can pass aQItemSelectiontoItemSelectionModel.select(selection, flags). Does anyone kn ow how this is possible? There is noItemSelectiontype which would wrapQItemSelection. The docs are silent on this.I am trying to implement shift-select to toggle a range in a
TableView2.Thanks!
-
Hi,
Why not set the SelectionMode of your view to
QAbstractItemView::ExtendedSelection? -
This is about the QML type and not the C++ type. Unless I’m misunderstanding you?
-
This is about the QML type and not the C++ type. Unless I’m misunderstanding you?
@patrickkidd said in How to select a range with ItemSelectionModel?:
This is about the QML type and not the C++ type. Unless I’m misunderstanding you?
Sorry, I misread your post.
Did you already saw this thread about that matter ?
-
@patrickkidd said in How to select a range with ItemSelectionModel?:
This is about the QML type and not the C++ type. Unless I’m misunderstanding you?
Sorry, I misread your post.
Did you already saw this thread about that matter ?
@sgaist said in How to select a range with ItemSelectionModel?:
@patrickkidd said in How to select a range with ItemSelectionModel?:
This is about the QML type and not the C++ type. Unless I’m misunderstanding you?
Sorry, I misread your post.
Did you already saw this thread about that matter ?
That thread is about Controls 1 while my question pertains to Controls 2 and item models.
-
I've made an example 'on a knee', but it uses some cheats. Maybe someone can provide some better examples.
Example -
I also need multiselect functionality in my
GridView. What I see, onlyTreeViewhasselectionproperty which can hold selection model. In my case, multiselect should be activated only when user holdCTRLkey in focusedGridView, I'm trying to solve this withCheckDelegateandnextCheckStatefunction callback -
I've made an example 'on a knee', but it uses some cheats. Maybe someone can provide some better examples.
Example@intruderexcluder said in How to select a range with ItemSelectionModel?:
I've made an example 'on a knee', but it uses some cheats. Maybe someone can provide some better examples.
ExampleI also am currently using a similar workaround where I have a C++
select(selectionModel, fromIndex, toIndex, SelectionFlags)that makes the call for me.So then my original question is if it is possible to make the same call directly from Qml.