diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-06-09 13:55:29 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-06-20 15:07:20 +0200 |
commit | 64fb25a2acada6d9f0897b7e8db4583de4d8d2be (patch) | |
tree | c15e1f36b90f924eed5ff53ea5123592fae31755 /src/qml/qml | |
parent | ebad08a26f07b53814a7f1afd7fb9536ba540609 (diff) |
Fix QQmlContext::nameForObject Qt 6 todo
Change-Id: I41949ea39a84c58ab261688b431f62ce864f49e2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlcontext.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontext.h | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp index 84d0fd611a..493a4ee70d 100644 --- a/src/qml/qml/qqmlcontext.cpp +++ b/src/qml/qml/qqmlcontext.cpp @@ -397,7 +397,7 @@ the case of QML created contexts. If the object has multiple names, the first is returned. */ -QString QQmlContext::nameForObject(QObject *object) const +QString QQmlContext::nameForObject(const QObject *object) const { Q_D(const QQmlContext); diff --git a/src/qml/qml/qqmlcontext.h b/src/qml/qml/qqmlcontext.h index 579f278b10..7eddfe1abb 100644 --- a/src/qml/qml/qqmlcontext.h +++ b/src/qml/qml/qqmlcontext.h @@ -83,8 +83,7 @@ public: void setContextProperty(const QString &, const QVariant &); void setContextProperties(const QVector<PropertyPair> &properties); - // ### Qt 6: no need for a mutable object, this should become a const QObject pointer - QString nameForObject(QObject *) const; + QString nameForObject(const QObject *) const; QUrl resolvedUrl(const QUrl &) const; |