| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import QtQuick 2.0
- import QtQuick.Controls 2.0
- Page {
- title: qsTr("nooLight")
- function showError(text) {
- ToolTip.show(text, 1000)
- }
- LightsModel {
- id: lightsModel
- serviceUrl: settings.serviceUrl
- onError: showError(text)
- }
- ListView {
- anchors.fill: parent
- anchors.margins: 5
- model: lightsModel
- spacing: 5
- delegate: LightGroup {
- width: parent.width
- height: childrenRect.height
- title: groupName || ""
- lights: channels
- onChannelClicked: {
- lightsModel.switchChannel(channelId)
- }
- }
- }
- BusyIndicator {
- anchors.centerIn: parent
- running: lightsModel.isLoading
- }
- }
|