first data showing up in qml
This commit is contained in:
parent
923d514dff
commit
2efb4a4fb9
3 changed files with 25 additions and 4 deletions
|
@ -5,22 +5,26 @@
|
|||
#include <QMap>
|
||||
#include <QNetworkReply>
|
||||
#include <QList>
|
||||
#include <QQmlListProperty>
|
||||
|
||||
#include "post.h"
|
||||
|
||||
class TinyTinyRSS : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QList<Post *> posts READ posts NOTIFY postsChanged)
|
||||
Q_PROPERTY(QQmlListProperty<Post> posts READ posts NOTIFY postsChanged)
|
||||
|
||||
public:
|
||||
TinyTinyRSS(QObject *parent = 0);
|
||||
~TinyTinyRSS();
|
||||
QList<Post *> posts() const { return mPosts; }
|
||||
|
||||
Q_INVOKABLE void initialize(const QString serverUrl, const QString sessionId);
|
||||
Q_INVOKABLE void reload();
|
||||
|
||||
QQmlListProperty<Post> posts();
|
||||
int postsCount() const;
|
||||
Post *post(int) const;
|
||||
|
||||
signals:
|
||||
void postsChanged(QList<Post *>);
|
||||
|
||||
|
@ -32,7 +36,7 @@ private:
|
|||
|
||||
QString mServerUrl;
|
||||
QString mSessionId;
|
||||
QList<Post *> mPosts;
|
||||
QList<Post*> mPosts;
|
||||
QNetworkAccessManager *mNetworkManager;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue