Warning, /education/labplot/src/kdefrontend/welcomescreen/RssNews.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.6
0002 import QtQuick.XmlListModel 2.0
0003 import QtQuick.Layouts 1.3
0004 import QtQuick.Controls 2.5
0005 
0006 Row {
0007     id: newsfeed
0008 
0009     Layout.fillHeight: true
0010     Layout.fillWidth: true
0011 
0012     XmlListModel {
0013         id: feedModel
0014 
0015         source: "https://labplot.kde.org/feed"
0016         query: "/rss/channel/item"
0017 
0018         XmlRole { name: "title"; query: "title/string()" }
0019         // Remove any links from the description
0020         XmlRole { name: "description"; query: "fn:replace(description/string(), '\<a href=.*\/a\>', '')" }
0021         XmlRole { name: "link"; query: "link/string()" }
0022         XmlRole { name: "pubDate"; query: "pubDate/string()" }
0023         XmlRole { name: "category"; query: "category/string()" }
0024     }
0025 
0026     ListView {
0027         id: list
0028         anchors.fill: parent
0029         //anchors.top: isPortrait ? categories.bottom : window.top
0030 
0031         clip: true
0032         model: feedModel
0033         footer: footerText
0034         delegate: NewsDelegate {}
0035         ScrollBar.vertical: ScrollBar { }
0036     }
0037 
0038     Component {
0039         id: footerText
0040 
0041         Rectangle {
0042             width: parent.width
0043             height: childrenRect.height + 10
0044             color: "lightgray"
0045 
0046             Text {
0047                 text: "RSS Feed from LabPlot"
0048                 anchors.centerIn: parent
0049                 font.pixelSize: 14
0050             }
0051         }
0052     }
0053 }
0054