aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/util/qqmladaptormodel_p.h
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-06-22 21:17:07 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-07-09 10:49:00 +0000
commitc78aa5857197e8ded675a35165b59d406a379e24 (patch)
tree46b7673ef563f110c9e8420d5bb00d07022348d7 /src/qml/util/qqmladaptormodel_p.h
parenta7f17c437e1c5b33ee6ac39e05f33ab3648a2fdc (diff)
QQmlDelegateModelItem: set row and column explicit
Whenever we set a model index on a model item, set row and column explicit as well. We used to calculate row and column by calling out to QQmlDelegateModel from within QQmlDelegateModelItem. But we want to remove the dependency to QQmlDelegateModel as much as possible, to be able to reuse QQmlDelegateModelItem also from other model classes (first and foremost the upcoming QQmlTableInstanceModel). Change-Id: Ib80b31250010b2611ba1715d3324145117add865 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/qml/util/qqmladaptormodel_p.h')
-rw-r--r--src/qml/util/qqmladaptormodel_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/util/qqmladaptormodel_p.h b/src/qml/util/qqmladaptormodel_p.h
index 3b2d180ca7..af0917cf3b 100644
--- a/src/qml/util/qqmladaptormodel_p.h
+++ b/src/qml/util/qqmladaptormodel_p.h
@@ -86,7 +86,7 @@ public:
virtual QQmlDelegateModelItem *createItem(
QQmlAdaptorModel &,
QQmlDelegateModelItemMetaType *,
- int) const { return nullptr; }
+ int, int, int) const { return nullptr; }
virtual bool notify(
const QQmlAdaptorModel &,
@@ -131,7 +131,7 @@ public:
inline QVariant value(int index, const QString &role) const {
return accessors->value(*this, index, role); }
inline QQmlDelegateModelItem *createItem(QQmlDelegateModelItemMetaType *metaType, int index) {
- return accessors->createItem(*this, metaType, index); }
+ return accessors->createItem(*this, metaType, index, rowAt(index), columnAt(index)); }
inline bool hasProxyObject() const {
return list.type() == QQmlListAccessor::Instance || list.type() == QQmlListAccessor::ListProperty; }