12-30-2012 05:06 PM
I'm trying to incorporate an RSS feed on one tab of my app. The issue I have is that it's not a .xml file I am managing myself. It is hosted from an external source and in in the more common format of <title>Example Title</title>. How can I convert it on the fly to <listItem title="Example Title" />(attribute format)? From there I know how to access and list the data into a ListItem.
I'm not very experienced with C++ so I'm hoping it's not too advanced. Even some guidance towards the right tutorials would be appreciated.
Solved! Go to Solution.
12-30-2012 08:51 PM - edited 12-30-2012 08:52 PM
I'm assuming I should use the code at the bottom of this link titled
I copy/pasted all of the QML into a news.qml. There were some brackets missing that caused an error, so I fixed them. I'm coming up with a black screen when I run the code from that sample.
I understand I'm supposed to copy some of the C++ as well into my main.cpp file.
// In a C++ source file in your app
// Register the DataSource class as a QML type so that it's accessible in QML
12-30-2012 09:14 PM
Use QNetworkAccessManager !
QNetworkRepy * reply = manager->get(QNetworkRequest("http://xxxxx/file");
QNetworkReply * reply = qobject_cast<QNetworkReply*>(sender());
QByteArray data = reply.readAll();
now, parse data !!