38 Q_PROPERTY(QDeclarativePlace *place READ place WRITE setPlace NOTIFY placeChanged)
39 Q_PROPERTY(
int batchSize READ batchSize WRITE setBatchSize NOTIFY batchSizeChanged)
40 Q_PROPERTY(
int totalCount READ totalCount NOTIFY totalCountChanged)
42 Q_INTERFACES(QQmlParserStatus)
45 explicit QDeclarativePlaceContentModel(QPlaceContent::Type type, QObject *parent =
nullptr);
46 ~QDeclarativePlaceContentModel();
48 QDeclarativePlace *place()
const;
49 void setPlace(QDeclarativePlace *place);
51 int batchSize()
const;
52 void setBatchSize(
int batchSize);
54 int totalCount()
const;
58 void initializeCollection(
int totalCount,
const QPlaceContent::Collection &collection);
61 int rowCount(
const QModelIndex &parent)
const override;
62 QVariant data(
const QModelIndex &index,
int role)
const override;
63 QHash<
int, QByteArray> roleNames()
const override;
66 ContentSupplierRole = Qt::UserRole,
68 ContentAttributionRole,
71 EditorialLanguageRole,
83 bool canFetchMore(
const QModelIndex &parent)
const override;
84 void fetchMore(
const QModelIndex &parent) override;
87 void classBegin() override;
88 void componentComplete() override;
92 void batchSizeChanged();
93 void totalCountChanged();
99 QPlaceContent::Collection m_content;
100 QMap<QString, QPlaceSupplier> m_suppliers;
101 QMap<QString, QPlaceUser>m_users;
104 QDeclarativePlace *m_place =
nullptr;
105 QPlaceContent::Type m_type;
107 int m_contentCount = -1;
109 QPlaceContentReply *m_reply =
nullptr;
110 QPlaceContentRequest m_nextRequest;
112 bool m_complete =
false;