Question

How can I select a few elements in the QML ListView and send its indices to C++ code?

Was it helpful?

Solution

I am pretty sure there is no way to make a QML ListView multi-selectable. Qt Declarative is focused on touch screen use and there is no meaningful way to multiselect in a pure touch UI.

OTHER TIPS

Do something like that: if an element is clicked, set its property selected (or however you call it), and set in delegate that if selected is true, then it should be formatted differently. Plus add it to some list, to work with it.

You may try to get the ListItem's data and store it to an array on odd click and remove the ListItem's data from the array on even click. May be a simple workout, instead of creating a list of check box like items.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top