summaryrefslogtreecommitdiffstats
path: root/basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml')
-rw-r--r--basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml20
1 files changed, 20 insertions, 0 deletions
diff --git a/basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml b/basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml
index 5bb1868..213d9e8 100644
--- a/basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml
+++ b/basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml
@@ -67,6 +67,14 @@ Rectangle {
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "link"; query: "link/string()" }
XmlRole { name: "description"; query: "description/string()" }
+
+ onStatusChanged: {
+ if (status == XmlListModel.Error) {
+ networkErrorBox.opacity = 1.0
+ } else if (status == XmlListModel.Ready) {
+ networkErrorBox.opacity = 0.0
+ }
+ }
}
Row {
@@ -93,9 +101,21 @@ Rectangle {
width: window.width - window.listWidth; height: window.height
model: feedModel
delegate: NewsDelegate {}
+
+ Item {
+ id: networkErrorBox
+ opacity: 0
+ anchors.fill: parent
+
+ Text {
+ anchors.centerIn: parent
+ text: qsTr("Sorry! No network connection")
+ }
+ }
}
}
+
ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right }
Rectangle { x: window.listWidth; height: window.height; width: 1; color: "#cccccc" }
}