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()
|
||||
}
|
||||
|
||||
function uncheckAll() {
|
||||
checked = {}
|
||||
}
|
||||
|
||||
function toggleCheck(...indices) {
|
||||
const checkedIndices = []
|
||||
|
||||
|
@ -121,7 +125,10 @@ GridView {
|
|||
}
|
||||
|
||||
onSelectedCountChanged: if (! selectedCount) lastCheckedDelegateIndex = 0
|
||||
onModelChanged: currentIndex = defaultCurrentIndex
|
||||
onModelChanged: {
|
||||
currentIndex = defaultCurrentIndex
|
||||
uncheckAll()
|
||||
}
|
||||
|
||||
HKineticScrollingDisabler {
|
||||
id: mouseArea
|
||||
|
|
|
@ -140,7 +140,10 @@ ListView {
|
|||
}
|
||||
|
||||
onSelectedCountChanged: if (! selectedCount) lastCheckedDelegateIndex = 0
|
||||
onModelChanged: currentIndex = defaultCurrentIndex
|
||||
onModelChanged: {
|
||||
currentIndex = defaultCurrentIndex
|
||||
uncheckAll()
|
||||
}
|
||||
|
||||
HKineticScrollingDisabler {
|
||||
width: enabled ? parent.width : 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user