Doc: Update source code for deleting alarms

Rewrote delete statement in AlarmDelegate.qml

Change-Id: Ib112103c0666a6bce34576da5f38594ceac14788
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
Nico Vertriest 2018-10-04 14:27:58 +02:00
parent cf145d6319
commit e8422196ce
2 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ ItemDelegate {
width: 40
height: 40
visible: root.checked
onClicked: alarmModel.remove(alarmListView.currentIndex, 1)
onClicked: root.ListView.view.model.remove(root.ListView.view.currentIndex, 1)
}
}
}

View File

@ -64,7 +64,7 @@ ApplicationWindow {
ListView {
id: alarmListView
anchors.fill: parent
model: AlarmModel { id: alarmModel }
model: AlarmModel {}
delegate: AlarmDelegate {}
}