1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00
ScreenPlay/Content/widget_rss_dw_news/main.qml

74 lines
1.7 KiB
QML
Raw Normal View History

// SPDX-License-Identifier: BSD-3-Clause
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material
import QtQuick.Effects
import QtQuick.Particles
import QtQml.XmlListModel
Item {
id: root
implicitWidth: 480
implicitHeight: 480
XmlListModel {
id: feedModel
source: "https://rss.dw.com/atom/rss-en-all"
query: "/feed/entry"
onCountChanged: {
2023-06-11 10:07:39 +02:00
console.log("count ", count);
}
onStatusChanged: {
2023-06-11 10:07:39 +02:00
print("status ", status);
console.log("count ", count);
if (status === XmlListModel.Error) {
console.log("Error: " + errorString);
}
}
2023-06-11 10:07:39 +02:00
XmlListModelRole {
name: "published"
elementName: "published"
}
XmlListModelRole {
name: "rights"
elementName: "rights"
}
XmlListModelRole {
name: "updated"
elementName: "updated"
}
XmlListModelRole {
name: "category"
elementName: "category"
attributeName: "term"
}
XmlListModelRole {
name: "title"
elementName: "title"
}
XmlListModelRole {
name: "link"
elementName: "link"
attributeName: "href"
}
XmlListModelRole {
name: "summary"
elementName: "summary"
}
}
ListView {
id: list
anchors.fill: parent
anchors.margins: 10
anchors.topMargin: 20
spacing: 10
model: feedModel
delegate: PostDelegate {
width: parent.width
}
}
}