diff options
author | Liang Qi <liang.qi@qt.io> | 2018-02-12 13:26:55 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-02-12 16:31:13 +0100 |
commit | 4d525de33e2ee55e69bb6c90fc11049a0f8b36b5 (patch) | |
tree | c9808baeabb1121f488a7b59ffff314cc62d80e8 /src/qml/qml/qqmlmetatype.cpp | |
parent | 47cd9da96371ccd495f6caabe1c6853258210ebb (diff) | |
parent | 3e3c6717ba634825a65069541500c40645a808ee (diff) |
Merge remote-tracking branch 'origin/5.10' into 5.11
Conflicts:
src/imports/shapes/qquickshape.cpp
src/imports/shapes/qquickshape_p_p.h
src/qml/compiler/qqmlpropertycachecreator_p.h
src/qml/jsruntime/qv4value_p.h
src/quick/items/qquickloader_p.h
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
tools/qmlprofiler/qmlprofilerapplication.cpp
Change-Id: Iafc66ae84bf78630ed72a986acb678e9d19e3a69
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index b324386bf5..76d40bf442 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -1566,6 +1566,12 @@ QString registrationTypeString(QQmlType::RegistrationType typeType) bool checkRegistration(QQmlType::RegistrationType typeType, QQmlMetaTypeData *data, const char *uri, const QString &typeName, int majorVersion = -1) { if (!typeName.isEmpty()) { + if (typeName.at(0).isLower()) { + QString failure(QCoreApplication::translate("qmlRegisterType", "Invalid QML %1 name \"%2\"; type names must begin with an uppercase letter")); + data->typeRegistrationFailures.append(failure.arg(registrationTypeString(typeType)).arg(typeName)); + return false; + } + int typeNameLen = typeName.length(); for (int ii = 0; ii < typeNameLen; ++ii) { if (!(typeName.at(ii).isLetterOrNumber() || typeName.at(ii) == '_')) { @@ -1803,6 +1809,9 @@ int QQmlPrivate::qmlregister(RegistrationType type, void *data) else return -1; + if (!dtype.isValid()) + return -1; + QMutexLocker lock(metaTypeDataLock()); QQmlMetaTypeData *typeData = metaTypeData(); typeData->undeletableTypes.insert(dtype); |