2023-02-25 12:44:46 +01:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
2023-03-09 10:19:58 +01:00
|
|
|
import QtQuick.Controls.Material
|
2023-02-25 12:44:46 +01:00
|
|
|
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);
|
2023-02-25 12:44:46 +01:00
|
|
|
}
|
|
|
|
onStatusChanged: {
|
2023-06-11 10:07:39 +02:00
|
|
|
print("status ", status);
|
|
|
|
console.log("count ", count);
|
2023-02-25 12:44:46 +01:00
|
|
|
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"
|
|
|
|
}
|
2023-02-25 12:44:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: list
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 10
|
|
|
|
anchors.topMargin: 20
|
|
|
|
spacing: 10
|
|
|
|
model: feedModel
|
|
|
|
delegate: PostDelegate {
|
|
|
|
width: parent.width
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|