diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-02 01:01:02 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-02 01:01:03 +0200 |
commit | a6a8832078caec920e02d68c2ce84b5587f6f0c0 (patch) | |
tree | 688a0799e231815895129a1570134c3e216d04f4 /src/qml | |
parent | d9aad59d4144f5bf725893b5a008fe5c52ff5634 (diff) | |
parent | 14109aaccc37df53a0c4b591dddd68b41ec20ec3 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I1dd04210f10895c509b5c637fc5e2dcf66e3bb91
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/doc/src/javascript/number.qdoc | 2 | ||||
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 23 |
4 files changed, 18 insertions, 11 deletions
diff --git a/src/qml/doc/src/javascript/number.qdoc b/src/qml/doc/src/javascript/number.qdoc index b6f80f474a..288232255c 100644 --- a/src/qml/doc/src/javascript/number.qdoc +++ b/src/qml/doc/src/javascript/number.qdoc @@ -96,7 +96,7 @@ \code var german = Qt.locale("de_DE"); var d; - d = Number.fromLocaleString(german, "1234,56) // d == 1234.56 + d = Number.fromLocaleString(german, "1234,56") // d == 1234.56 d = Number.fromLocaleString(german, "1.234,56") // d == 1234.56 d = Number.fromLocaleString(german, "1234.56") // throws exception d = Number.fromLocaleString(german, "1.234") // d == 1234.0 diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index f6fb93eab3..1ab6e8c767 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -1368,7 +1368,7 @@ QObject *QJSValue::toQObject() const \since 5.8 * If this QJSValue is a QMetaObject, returns the QMetaObject pointer - * that the QJSValue represents; otherwise, returns 0. + * that the QJSValue represents; otherwise, returns \nullptr. * * \sa isQMetaObject() */ diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index a31dbd1e08..a79d4d074c 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1331,7 +1331,7 @@ bool QQmlImportsPrivate::locateQmldir(const QString &uri, int vmaj, int vmin, QQ QString url; const QStringRef absolutePath = absoluteFilePath.leftRef(absoluteFilePath.lastIndexOf(Slash) + 1); if (absolutePath.at(0) == Colon) - url = QLatin1String("qrc://") + absolutePath.mid(1); + url = QLatin1String("qrc") + absolutePath; else url = QUrl::fromLocalFile(absolutePath.toString()).toString(); diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index e4fd42932f..a8ec5d18f8 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -261,7 +261,8 @@ public: int index; mutable volatile bool isSetup:1; - mutable volatile bool isEnumSetup:1; + mutable volatile bool isEnumFromCacheSetup:1; + mutable volatile bool isEnumFromBaseSetup:1; mutable bool haveSuperType:1; mutable QList<QQmlProxyMetaObject::ProxyData> metaObjects; mutable QStringHash<int> enums; @@ -367,7 +368,8 @@ QHash<const QMetaObject *, int> QQmlTypePrivate::attachedPropertyIds; QQmlTypePrivate::QQmlTypePrivate(QQmlType::RegistrationType type) : refCount(1), regType(type), iid(nullptr), typeId(0), listId(0), revision(0), containsRevisionedAttributes(false), baseMetaObject(nullptr), - index(-1), isSetup(false), isEnumSetup(false), haveSuperType(false) + index(-1), isSetup(false), isEnumFromCacheSetup(false), isEnumFromBaseSetup(false), + haveSuperType(false) { switch (type) { case QQmlType::CppType: @@ -829,19 +831,24 @@ void QQmlTypePrivate::init() const void QQmlTypePrivate::initEnums(const QQmlPropertyCache *cache) const { - if (isEnumSetup) return; + if ((isEnumFromBaseSetup || !baseMetaObject) + && (isEnumFromCacheSetup || !cache)) { + return; + } init(); QMutexLocker lock(metaTypeDataLock()); - if (isEnumSetup) return; - if (cache) + if (!isEnumFromCacheSetup && cache) { insertEnumsFromPropertyCache(cache); - if (baseMetaObject) // could be singleton type without metaobject - insertEnums(baseMetaObject); + isEnumFromCacheSetup = true; + } - isEnumSetup = true; + if (!isEnumFromBaseSetup && baseMetaObject) { // could be singleton type without metaobject + insertEnums(baseMetaObject); + isEnumFromBaseSetup = true; + } } void QQmlTypePrivate::insertEnums(const QMetaObject *metaObject) const |