Fix state corruption caused by having 2 separate ComputerModels. Fixes #6
This commit is contained in:
parent
32f305347f
commit
be52272e5c
1 changed files with 2 additions and 4 deletions
|
|
@ -81,7 +81,7 @@ GridView {
|
||||||
return model
|
return model
|
||||||
}
|
}
|
||||||
|
|
||||||
model: createModel()
|
model: computerModel
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
width: 300; height: 300;
|
width: 300; height: 300;
|
||||||
|
|
@ -250,12 +250,10 @@ GridView {
|
||||||
modality:Qt.WindowModal
|
modality:Qt.WindowModal
|
||||||
property int pcIndex : -1;
|
property int pcIndex : -1;
|
||||||
text:"Are you sure you want to remove this PC?"
|
text:"Are you sure you want to remove this PC?"
|
||||||
standardButtons: StandardButton.Yes |StandardButton.No
|
standardButtons: StandardButton.Yes | StandardButton.No
|
||||||
onYes: {
|
onYes: {
|
||||||
console.log("deleting PC pairing for PC at index: " + pcIndex)
|
console.log("deleting PC pairing for PC at index: " + pcIndex)
|
||||||
computerModel.deleteComputer(pcIndex);
|
computerModel.deleteComputer(pcIndex);
|
||||||
// hack to remove the child from the gridview
|
|
||||||
model = createModel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue