forked from jeena/FeedTheMonkey
first data showing up in qml
This commit is contained in:
parent
923d514dff
commit
2efb4a4fb9
3 changed files with 25 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue