39 Q_PROPERTY(QDeclarativePlace *place READ place WRITE setPlace NOTIFY placeChanged)
40 Q_PROPERTY(
int batchSize READ batchSize WRITE setBatchSize NOTIFY batchSizeChanged)
41 Q_PROPERTY(
int totalCount READ totalCount NOTIFY totalCountChanged)
43 Q_INTERFACES(QQmlParserStatus)
46 explicit QDeclarativePlaceContentModel(QPlaceContent::Type type, QObject *parent =
nullptr);
47 ~QDeclarativePlaceContentModel();
49 QDeclarativePlace *place()
const;
50 void setPlace(QDeclarativePlace *place);
52 int batchSize()
const;
53 void setBatchSize(
int batchSize);
55 int totalCount()
const;
59 void initializeCollection(
int totalCount,
const QPlaceContent::Collection &collection);
62 int rowCount(
const QModelIndex &parent)
const override;
63 QVariant data(
const QModelIndex &index,
int role)
const override;
64 QHash<
int, QByteArray> roleNames()
const override;
67 ContentSupplierRole = Qt::UserRole,
69 ContentAttributionRole,
72 EditorialLanguageRole,
84 bool canFetchMore(
const QModelIndex &parent)
const override;
85 void fetchMore(
const QModelIndex &parent) override;
88 void classBegin() override;
89 void componentComplete() override;
93 void batchSizeChanged();
94 void totalCountChanged();
100 QPlaceContent::Collection m_content;
101 QMap<QString, QPlaceSupplier> m_suppliers;
102 QMap<QString, QPlaceUser>m_users;
105 QDeclarativePlace *m_place =
nullptr;
106 QPlaceContent::Type m_type;
108 int m_contentCount = -1;
110 QPlaceContentReply *m_reply =
nullptr;
111 QPlaceContentRequest m_nextRequest;
113 bool m_complete =
false;