diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-12-15 16:40:30 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-12-18 22:00:27 +0100 |
commit | 7c59afe361aeb7dee94b9d0093420e6133b8c434 (patch) | |
tree | 73b304fb5da558a369537afbf45058996648bb76 /src/qml/jsapi | |
parent | d9ef072d73801eb8d92b07809239d4d59fe90690 (diff) |
QJSValue: document that isUrl only returns true for JS URL objects
It does not return true for a QJSValue that carries a QVariant with a
QUrl. However, on the C++ side the caller will want the URL value anyway
as a QUrl, and in both cases, going through the QVariant works for that.
Fixes: QTBUG-119794
Pick-to: 6.7 6.6 6.5
Change-Id: I90fd4a1a27d4dd4758b1060205ce2aeec730eb72
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsapi')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index dd3bb98002..bc75526e8d 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -372,8 +372,11 @@ bool QJSValue::isError() const } /*! - Returns true if this QJSValue is an object of the URL class; + Returns true if this QJSValue is an object of the URL JavaScript class; otherwise returns false. + + \note For a QJSValue that contains a QUrl, this function returns false. + However, \c{toVariant().value<QUrl>()} works in both cases. */ bool QJSValue::isUrl() const { |