import QtQml.Models 2.1 ListModel { id: root readonly property var client: NooLiteClient { id: nooLiteClient onError: { root.error(text) root.isLoading = false } onModelLoad: { root.populateModel(data) root.isLoading = false } } property alias serviceUrl: nooLiteClient.serviceUrl property bool isLoading: false signal error(string text) onServiceUrlChanged: reload() function reload() { root.client.loadModel() root.isLoading = true } function populateModel(data) { data.groups.forEach(function (group) { root.append(group) }) } function switchChannel(channelId) { root.client.switchChannel(channelId) } }