summaryrefslogtreecommitdiff
path: root/src/ivicore
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2019-12-06 16:17:42 +0100
committerDominik Holland <dominik.holland@qt.io>2019-12-17 21:45:44 +0100
commitec541913b637bad584d730248458e11b6e49dbe4 (patch)
tree4a0d7232ffddd327b1f91321653d4dbdfc4a0592 /src/ivicore
parentf1e9eea76ff1e97c635e7676a3bf0158b29d2b30 (diff)
downloadqtivi-ec541913b637bad584d730248458e11b6e49dbe4.tar.gz
ivigenerator: Fix iterating over the items of a model inside a simulation
From inside the QML simulation it was not possible to properly iterate over all items of a model. The missing count property is added by this commit. In addition the at() method is fixed to return the Q_GADGET based type by copy instead of returning a const ref, as QML cannot cope with that. Change-Id: Id12f05814684d3e9d482601fbaa788dc9c450df3 Fixes: AUTOSUITE-1371 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'src/ivicore')
-rw-r--r--src/ivicore/qivipagingmodelinterface.cpp4
-rw-r--r--src/ivicore/qivipagingmodelinterface.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/ivicore/qivipagingmodelinterface.cpp b/src/ivicore/qivipagingmodelinterface.cpp
index 2d528d6..c8fed22 100644
--- a/src/ivicore/qivipagingmodelinterface.cpp
+++ b/src/ivicore/qivipagingmodelinterface.cpp
@@ -123,10 +123,10 @@ QIviPagingModelInterface::QIviPagingModelInterface(QObjectPrivate &dd, QObject *
*/
/*!
- \fn void QIviPagingModelInterface::countChanged(const QUuid &identifier, int newLength)
+ \fn void QIviPagingModelInterface::countChanged(const QUuid &identifier, int count)
This signal is emitted when the current number of items in the QIviPagingModel instance identified by \a identifier changed.
- The new number of items is returned as \a newLength.
+ The new number of items is returned as \a count.
This signal is expected to be emitted after the model instance has requested new data for the first time by calling fetchData() and
should be emitted before the data is returned by emitting the dataFetched() signal.
diff --git a/src/ivicore/qivipagingmodelinterface.h b/src/ivicore/qivipagingmodelinterface.h
index 0f3375a..4a6973e 100644
--- a/src/ivicore/qivipagingmodelinterface.h
+++ b/src/ivicore/qivipagingmodelinterface.h
@@ -69,7 +69,7 @@ protected:
Q_SIGNALS:
void supportedCapabilitiesChanged(const QUuid &identifier, QtIviCoreModule::ModelCapabilities capabilities);
- void countChanged(const QUuid &identifier, int newLength);
+ void countChanged(const QUuid &identifier = QUuid(), int count = -1);
void dataFetched(const QUuid &identifier, const QList<QVariant> &data, int start, bool moreAvailable);
void dataChanged(const QUuid &identifier, const QList<QVariant> &data, int start, int count);
};