aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-10 01:01:21 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-04-10 09:35:18 +0200
commit35f59635087a36e5037a9590ce0b0da0b138c488 (patch)
tree51e56fefa3b13fe69d290473f19e86cad3ef8ba6 /src/qml
parent96c4fffd8648e9c9fb95e8208a76933c8c2120bc (diff)
parent8c3172d724f3ad03cdee7bae23443fa109d350b1 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: src/qml/qml/qqmlmetatype.cpp src/qml/types/qqmlmodelsmodule.cpp Change-Id: Idc63689ba98d83a455283674f4b5cf3014473605
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/doc/src/javascript/number.qdoc2
-rw-r--r--src/qml/jsapi/qjsvalue.cpp2
-rw-r--r--src/qml/jsruntime/qv4internalclass_p.h2
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp3
-rw-r--r--src/qml/qml/qqmlimport.cpp2
-rw-r--r--src/qml/qml/qqmltype.cpp20
-rw-r--r--src/qml/qml/qqmltype_p_p.h3
-rw-r--r--src/qml/types/qqmlmodelsmodule.cpp2
8 files changed, 23 insertions, 13 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 1031d686e7..e0bd986920 100644
--- a/src/qml/jsapi/qjsvalue.cpp
+++ b/src/qml/jsapi/qjsvalue.cpp
@@ -1367,7 +1367,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/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h
index 42b61218a5..7bb10f47a3 100644
--- a/src/qml/jsruntime/qv4internalclass_p.h
+++ b/src/qml/jsruntime/qv4internalclass_p.h
@@ -457,7 +457,7 @@ private:
InternalClass *addMemberImpl(PropertyKey identifier, PropertyAttributes data, InternalClassEntry *entry);
void removeChildEntry(InternalClass *child);
- friend struct ExecutionEngine;
+ friend struct ::QV4::ExecutionEngine;
};
inline
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 359ea0fcfa..8f2b162106 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -1501,7 +1501,7 @@ ReturnedValue Runtime::CallProperty::call(ExecutionEngine *engine, const Value &
if (!f) {
QString error = QStringLiteral("Property '%1' of object %2 is not a function")
- .arg(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]->toQString(),
+ .arg(name->toQString(),
base->toQStringNoThrow());
return engine->throwTypeError(error);
}
@@ -2085,6 +2085,7 @@ ReturnedValue Runtime::Div::call(const Value &left, const Value &right)
int lval = left.integerValue();
int rval = right.integerValue();
if (rval != 0 // division by zero should result in a NaN
+ && !(lval == std::numeric_limits<int>::min() && rval == -1) // doesn't fit in int
&& (lval % rval == 0) // fractions can't be stored in an int
&& !(lval == 0 && rval < 0)) // 0 / -something results in -0.0
return Encode(int(lval / rval));
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 09d430b5c0..d2d37164a7 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1263,7 +1263,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/qqmltype.cpp b/src/qml/qml/qqmltype.cpp
index efe190cbcf..df8078fb58 100644
--- a/src/qml/qml/qqmltype.cpp
+++ b/src/qml/qml/qqmltype.cpp
@@ -118,7 +118,8 @@ QJSValue QQmlType::SingletonInstanceInfo::scriptApi(QQmlEngine *e) const
QQmlTypePrivate::QQmlTypePrivate(QQmlType::RegistrationType type)
: 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:
@@ -347,19 +348,24 @@ void QQmlTypePrivate::init() const
void QQmlTypePrivate::initEnums(const QQmlPropertyCache *cache) const
{
- if (isEnumSetup) return;
+ if ((isEnumFromBaseSetup || !baseMetaObject)
+ && (isEnumFromCacheSetup || !cache)) {
+ return;
+ }
init();
QMutexLocker lock(QQmlMetaType::typeRegistrationLock());
- 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
diff --git a/src/qml/qml/qqmltype_p_p.h b/src/qml/qml/qqmltype_p_p.h
index 380139f385..dd6e046129 100644
--- a/src/qml/qml/qqmltype_p_p.h
+++ b/src/qml/qml/qqmltype_p_p.h
@@ -120,7 +120,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;
diff --git a/src/qml/types/qqmlmodelsmodule.cpp b/src/qml/types/qqmlmodelsmodule.cpp
index 119ede256f..5423054934 100644
--- a/src/qml/types/qqmlmodelsmodule.cpp
+++ b/src/qml/types/qqmlmodelsmodule.cpp
@@ -74,9 +74,11 @@ void QQmlModelsModule::defineLabsModule()
{
const char uri[] = "Qt.labs.qmlmodels";
+#if QT_CONFIG(qml_delegate_model)
qmlRegisterUncreatableType<QQmlAbstractDelegateComponent>(uri, 1, 0, "AbstractDelegateComponent", QQmlAbstractDelegateComponent::tr("Cannot create instance of abstract class AbstractDelegateComponent."));
qmlRegisterType<QQmlDelegateChooser>(uri, 1, 0, "DelegateChooser");
qmlRegisterType<QQmlDelegateChoice>(uri, 1, 0, "DelegateChoice");
+#endif
qmlRegisterType<QQmlTableModel>(uri, 1, 0, "TableModel");
qmlRegisterType<QQmlTableModelColumn>(uri, 1, 0, "TableModelColumn");
}