multi select for service item
This commit is contained in:
parent
50c17705f6
commit
02c4c8a47a
3 changed files with 49 additions and 3 deletions
|
@ -240,7 +240,9 @@ Item {
|
|||
onClicked: {
|
||||
if (mouse.button === Qt.RightButton)
|
||||
rightClickMenu.popup(mouse);
|
||||
else {
|
||||
else if ((mouse.button === Qt.LeftButton) && (mouse.modifiers === Qt.ShiftModifier)) {
|
||||
selectItems(index);
|
||||
} else {
|
||||
serviceItemList.currentIndex = index;
|
||||
ServiceItemModel.select(index);
|
||||
}
|
||||
|
@ -577,7 +579,21 @@ Item {
|
|||
/* totalServiceItems++; */
|
||||
}
|
||||
|
||||
function changeItem() {
|
||||
function selectItems(index) {
|
||||
if (index === serviceItemList.currentIndex)
|
||||
return;
|
||||
var arr = [];
|
||||
if (index > serviceItemList.currentIndex) {
|
||||
for (let i = serviceItemList.currentIndex; i < index + 1; i++) {
|
||||
arr.push(i);
|
||||
console.log("Select all these here items..." + arr);
|
||||
}
|
||||
} else {
|
||||
for (let i = serviceItemList.currentIndex; i > index - 1; i--) {
|
||||
arr.push(i);
|
||||
console.log("Select all these here items..." + arr);
|
||||
}
|
||||
}
|
||||
ServiceItemModel.selectItems(arr);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue