29 lines
714 B
QML
29 lines
714 B
QML
|
|
// Auto-generated by `bin/console make:bridge:resource Todo`.
|
||
|
|
// Drop this into your QML and customize the delegate to taste.
|
||
|
|
|
||
|
|
import QtQuick
|
||
|
|
import QtQuick.Controls
|
||
|
|
import PhpQml.Bridge
|
||
|
|
|
||
|
|
ListView {
|
||
|
|
id: todoList
|
||
|
|
|
||
|
|
model: ReactiveListModel {
|
||
|
|
baseUrl: BackendConnection.url
|
||
|
|
token: BackendConnection.token
|
||
|
|
source: "/api/todos"
|
||
|
|
topic: "app://model/todo"
|
||
|
|
}
|
||
|
|
|
||
|
|
delegate: ItemDelegate {
|
||
|
|
required property string id
|
||
|
|
required property string title
|
||
|
|
required property bool done
|
||
|
|
required property bool pending
|
||
|
|
|
||
|
|
text: title + (done ? " ✓" : "")
|
||
|
|
opacity: pending ? 0.5 : 1.0
|
||
|
|
width: ListView.view.width
|
||
|
|
}
|
||
|
|
}
|