diff options
| author | Albert Astals Cid <aacid@kde.org> | 2022-08-09 09:49:41 +0200 |
|---|---|---|
| committer | Albert Astals Cid <aacid@kde.org> | 2024-09-05 22:12:06 +0200 |
| commit | c5f50cf7deda4330c569fe28ba1d015898b7cdbf (patch) | |
| tree | d1d0c5f101050460693f05b30b7d84be21da0078 | |
| parent | c0f101587a7280d0ff823682b94cda2fca4708db (diff) | |
Tweak error message about non bindable properties
It is not necessarily the NOTIFY that is missing, e.g. I recently
saw an example that was missing the READ property declaration
but the error message still said "you don't have a NOTIFY" and well, the
code did indeed have NOTIFY so it was a bit disconcerting until i
realized the READ was missing.
Change-Id: Ic5bd4c2be0cd6229ab8cc543be235bbd147ae818
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| -rw-r--r-- | src/qml/doc/src/cppintegration/extending-tutorial.qdoc | 2 | ||||
| -rw-r--r-- | src/qml/qml/qqmljavascriptexpression.cpp | 2 | ||||
| -rw-r--r-- | src/qml/qml/qqmltypewrapper.cpp | 2 | ||||
| -rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc index b16368a77a..2176a17ea8 100644 --- a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc +++ b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc @@ -156,7 +156,7 @@ Now we can build and run the application: \image extending-tutorial-chapter1.png -\note You may see a warning \e {Expression ... depends on non-NOTIFYable properties: +\note You may see a warning \e {Expression ... depends on non-bindable properties: PieChart::name}. This happens because we add a binding to the writable \c name property, but haven't yet defined a notify signal for it. The QML engine therefore cannot update the binding if the \c name value changes. This is addressed in diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index d7cf38984b..ccd91d17db 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -405,7 +405,7 @@ void QQmlPropertyCapture::captureNonBindableProperty(QObject *o, int n, int c, b errorString = new QStringList; QString preamble = QLatin1String("QQmlExpression: Expression ") + expression->expressionIdentifier() + - QLatin1String(" depends on non-NOTIFYable properties:"); + QLatin1String(" depends on non-bindable properties:"); errorString->append(preamble); } diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp index 12811ee195..0c2d46a20a 100644 --- a/src/qml/qml/qqmltypewrapper.cpp +++ b/src/qml/qml/qqmltypewrapper.cpp @@ -337,7 +337,7 @@ ReturnedValue QQmlTypeWrapper::virtualGet(const Managed *m, PropertyKey id, cons } else if (type.isQJSValueSingleton()) { QJSValue scriptSingleton = enginePrivate->singletonInstance<QJSValue>(type); if (!scriptSingleton.isUndefined()) { - // NOTE: if used in a binding, changes will not trigger re-evaluation since non-NOTIFYable. + // NOTE: if used in a binding, changes will not trigger re-evaluation since non-bindable. QV4::ScopedObject o(scope, QJSValuePrivate::asReturnedValue(&scriptSingleton)); if (!!o) return o->get(name); diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index c0d3fc0fb1..204bb8045a 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -1495,7 +1495,7 @@ void tst_qqmlecmascript::enums() // Non-existent enums { QUrl file = testFileUrl("enums.2.qml"); - QString w2 = QLatin1String("QQmlExpression: Expression ") + testFileUrl("enums.2.qml").toString() + QLatin1String(":9:5 depends on non-NOTIFYable properties:"); + QString w2 = QLatin1String("QQmlExpression: Expression ") + testFileUrl("enums.2.qml").toString() + QLatin1String(":9:5 depends on non-bindable properties:"); QString w3 = QLatin1String(" MyUnregisteredEnumTypeObject::enumProperty"); QString w4 = file.toString() + ":7:5: Unable to assign [undefined] to int"; QString w5 = file.toString() + ":8:5: Unable to assign [undefined] to int"; @@ -7529,7 +7529,7 @@ void tst_qqmlecmascript::nonNotifyable() QString expected1 = QLatin1String("QQmlExpression: Expression ") + component.url().toString() + - QLatin1String(":5:5 depends on non-NOTIFYable properties:"); + QLatin1String(":5:5 depends on non-bindable properties:"); QString expected2 = QLatin1String(" ") + QLatin1String(object->metaObject()->className()) + QLatin1String("::value"); @@ -7545,7 +7545,7 @@ void tst_qqmlecmascript::nonNotifyableConstant() QQmlComponent component(&engine, testFileUrl("nonNotifyableConstant.qml")); QQmlTestMessageHandler messageHandler; - // Shouldn't produce an error message about non-NOTIFYable properties, + // Shouldn't produce an error message about non-bindable properties, // as the property has the CONSTANT attribute. QScopedPointer<QObject> object(component.create()); QVERIFY2(object, qPrintable(component.errorString())); |
