first data showing up in qml

This commit is contained in:
Jeena 2015-01-14 23:16:11 +01:00
parent 923d514dff
commit 2efb4a4fb9
3 changed files with 25 additions and 4 deletions

View file

@ -8,6 +8,8 @@
TinyTinyRSS::TinyTinyRSS(QObject *parent) :
QObject(parent)
{
qRegisterMetaType<QList<Post *> >();
mNetworkManager = new QNetworkAccessManager(this);
mPosts = QList<Post *>();
}
@ -87,3 +89,18 @@ void TinyTinyRSS::reply()
reply->deleteLater();
}
}
QQmlListProperty<Post> TinyTinyRSS::posts()
{
return QQmlListProperty<Post>(this, mPosts);
}
int TinyTinyRSS::postsCount() const
{
return mPosts.count();
}
Post *TinyTinyRSS::post(int index) const
{
return mPosts.at(index);
}