Clear HList/GridView checked on model change
Clear the checked items and prevent potential segfaults
This commit is contained in:
parent
58613446f0
commit
d9118ef24e
|
@ -41,6 +41,10 @@ GridView {
|
||||||
checkedChanged()
|
checkedChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uncheckAll() {
|
||||||
|
checked = {}
|
||||||
|
}
|
||||||
|
|
||||||
function toggleCheck(...indices) {
|
function toggleCheck(...indices) {
|
||||||
const checkedIndices = []
|
const checkedIndices = []
|
||||||
|
|
||||||
|
@ -121,7 +125,10 @@ GridView {
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelectedCountChanged: if (! selectedCount) lastCheckedDelegateIndex = 0
|
onSelectedCountChanged: if (! selectedCount) lastCheckedDelegateIndex = 0
|
||||||
onModelChanged: currentIndex = defaultCurrentIndex
|
onModelChanged: {
|
||||||
|
currentIndex = defaultCurrentIndex
|
||||||
|
uncheckAll()
|
||||||
|
}
|
||||||
|
|
||||||
HKineticScrollingDisabler {
|
HKineticScrollingDisabler {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
|
|
|
@ -140,7 +140,10 @@ ListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelectedCountChanged: if (! selectedCount) lastCheckedDelegateIndex = 0
|
onSelectedCountChanged: if (! selectedCount) lastCheckedDelegateIndex = 0
|
||||||
onModelChanged: currentIndex = defaultCurrentIndex
|
onModelChanged: {
|
||||||
|
currentIndex = defaultCurrentIndex
|
||||||
|
uncheckAll()
|
||||||
|
}
|
||||||
|
|
||||||
HKineticScrollingDisabler {
|
HKineticScrollingDisabler {
|
||||||
width: enabled ? parent.width : 0
|
width: enabled ? parent.width : 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user