Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to select more than one delegates in listview
jd42 last edited by
i have a listview with readonly text delegates, how can i visually select more than one delegates by pressing and moving the mouse over multiple delegates? E.g. there are multiple chat messages and i want to select some of them to be able to copy them. Is there any way to do that?
Thanks in advance.
Padlock last edited by
Does this (https://stackoverflow.com/questions/38438235/multiple-items-selection-from-listview) answer your question?
sharath last edited by sharath
@jd42 why do you want to select more than one delegate? Do you want to delete particular or group of index from list view or you want to copy that index?
First of all you have to implement Pressandhold and Onclick functionality on mouseArea and specify z=-1
import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Controls 2.1
import "Utilitiesforarray.js" as Utilsarray
property bool flag: false
//initially flag becomes flase, after PressandHold the flag becomes true
Utilsarray.pushIndex(index); //storing index in array, i have method called pushIndex in Utilitiesforarray.js file
//now you can select how many delegates you want
//do your stuff