Добавлен PullToRefresh для ListView
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls 2.0
|
||||||
|
|
||||||
|
import ru.ded.components 1.0
|
||||||
|
|
||||||
Page {
|
Page {
|
||||||
title: qsTr("nooLight")
|
title: qsTr("nooLight")
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
id: listView
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 5
|
anchors.margins: 5
|
||||||
|
|
||||||
@@ -12,7 +16,7 @@ Page {
|
|||||||
spacing: 5
|
spacing: 5
|
||||||
|
|
||||||
delegate: LightGroup {
|
delegate: LightGroup {
|
||||||
width: parent.width
|
width: listView.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
title: groupName || ""
|
title: groupName || ""
|
||||||
@@ -22,6 +26,16 @@ Page {
|
|||||||
lightsModel.switchChannel(channelId)
|
lightsModel.switchChannel(channelId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PoolToRefresh {
|
||||||
|
anchors.top: parent.top
|
||||||
|
width: parent.width
|
||||||
|
height: 30
|
||||||
|
|
||||||
|
onUpdate: {
|
||||||
|
lightsModel.reload()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BusyIndicator {
|
BusyIndicator {
|
||||||
|
|||||||
Reference in New Issue
Block a user