Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QML ListView multiselection

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

like image 567
Yury Avatar asked Dec 21 '22 22:12

Yury


2 Answers

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.

like image 128
marmistrz Avatar answered Dec 30 '22 02:12

marmistrz


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.

like image 30
teukkam Avatar answered Dec 30 '22 01:12

teukkam