aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels/qqmlobjectmodel.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-10-01 10:11:42 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-10-21 14:16:54 +0200
commitfecfa43cfac329a5b50663cd04bb74bf5a63ca6f (patch)
tree9be27b510d6d8cf3a3a0d0938c7a73d6c4ba7c41 /src/qmlmodels/qqmlobjectmodel.cpp
parent866f7f3c7b35194aac6b5a4409de847b2363e069 (diff)
QQmlObjectModel: Return object property from variantValue()
Returning a context property was a strange choice. We want to get rid of context properties. [ChangeLog][Important Behavior Changes] The QML ObjectModel type had an undocumented "feature" which made it sort items in list views into sections according to context properties of the QML context the created objects belong to. Instead of context properties, object properties are used now. Change-Id: Ibd94c903910f0cdb76ead50db92a24eefebfa3fc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qmlmodels/qqmlobjectmodel.cpp')
-rw-r--r--src/qmlmodels/qqmlobjectmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qmlmodels/qqmlobjectmodel.cpp b/src/qmlmodels/qqmlobjectmodel.cpp
index 7409178616..c833206525 100644
--- a/src/qmlmodels/qqmlobjectmodel.cpp
+++ b/src/qmlmodels/qqmlobjectmodel.cpp
@@ -278,7 +278,7 @@ QVariant QQmlObjectModel::variantValue(int index, const QString &role)
Q_D(QQmlObjectModel);
if (index < 0 || index >= d->children.count())
return QString();
- return QQmlEngine::contextForObject(d->children.at(index).item)->contextProperty(role);
+ return d->children.at(index).item->property(role.toUtf8().constData());
}
QQmlIncubator::Status QQmlObjectModel::incubationStatus(int)