diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-07 19:31:56 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-07 19:31:57 +0100 |
commit | b8fd0ed3a47558b4ace480526cddffa51d6f0580 (patch) | |
tree | 926095da42e111933bdb3a63c1a9e0a14fa4041f /src/qml | |
parent | 669c554516736a6735b7286039c56cc0e8d56e05 (diff) | |
parent | 443ba99b1ef825e198fe1999c34ee44547135797 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: Icfa1d61fcc286c3418d4a625de11d2191336fa60
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsapi/qjsengine.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 7 | ||||
-rw-r--r-- | src/qml/qml/qqml.h | 55 | ||||
-rw-r--r-- | src/qml/qml/qqmlapplicationengine.h | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponent.h | 18 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontext.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlcontext.h | 4 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlexpression.h | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlextensionplugin.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlfileselector.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmllist.h | 36 | ||||
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 2 | ||||
-rw-r--r-- | src/qml/types/qqmllistmodelworkeragent_p.h | 3 | ||||
-rw-r--r-- | src/qml/util/qqmlpropertymap.h | 2 |
15 files changed, 93 insertions, 56 deletions
diff --git a/src/qml/jsapi/qjsengine.h b/src/qml/jsapi/qjsengine.h index 300990873d..6ecd0c7ec0 100644 --- a/src/qml/jsapi/qjsengine.h +++ b/src/qml/jsapi/qjsengine.h @@ -111,7 +111,7 @@ private: friend inline bool qjsvalue_cast_helper(const QJSValue &, int, void *); protected: - QJSEngine(QJSEnginePrivate &dd, QObject *parent = 0); + QJSEngine(QJSEnginePrivate &dd, QObject *parent = Q_NULLPTR); private: QV8Engine *d; diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index e8320b33d2..514bdafb48 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -119,11 +119,14 @@ struct Q_QML_PRIVATE_EXPORT Value Q_ALWAYS_INLINE quint32 value() const { return _val >> 32; } #endif -#ifdef QV4_USE_64_BIT_VALUE_ENCODING +#if defined(V4_BOOTSTRAP) + Q_ALWAYS_INLINE Heap::Base *m() const { Q_UNREACHABLE(); return Q_NULLPTR; } + Q_ALWAYS_INLINE void setM(Heap::Base *b) { Q_UNUSED(b); Q_UNREACHABLE(); } +#elif defined(QV4_USE_64_BIT_VALUE_ENCODING) Q_ALWAYS_INLINE Heap::Base *m() const { Heap::Base *b; memcpy(&b, &_val, 8); return b; } Q_ALWAYS_INLINE void setM(Heap::Base *b) { memcpy(&_val, &b, 8); } #else // !QV4_USE_64_BIT_VALUE_ENCODING - Q_ALWAYS_INLINE Heap::Base *m() const { Heap::Base *b; quint32 v = value(); memcpy(&b, &v, 4); return b; } + Q_ALWAYS_INLINE Heap::Base *m() const { Q_STATIC_ASSERT(sizeof(Heap::Base*) == sizeof(quint32)); Heap::Base *b; quint32 v = value(); memcpy(&b, &v, 4); return b; } Q_ALWAYS_INLINE void setM(Heap::Base *b) { quint32 v; memcpy(&v, &b, 4); setValue(v); } #endif diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index a71d06f7de..8fb710ad9d 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -111,10 +111,11 @@ int qmlRegisterType() qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), - 0, 0, + 0, + Q_NULLPTR, QString(), - 0, 0, 0, 0, &T::staticMetaObject, + Q_NULLPTR, 0, 0, Q_NULLPTR, &T::staticMetaObject, QQmlPrivate::attachedPropertiesFunc<T>(), QQmlPrivate::attachedPropertiesMetaObject<T>(), @@ -123,9 +124,9 @@ int qmlRegisterType() QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - 0, 0, + Q_NULLPTR, Q_NULLPTR, - 0, + Q_NULLPTR, 0 }; @@ -144,7 +145,8 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), - 0, 0, + 0, + Q_NULLPTR, reason, uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -156,9 +158,9 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - 0, 0, + Q_NULLPTR, Q_NULLPTR, - 0, + Q_NULLPTR, 0 }; @@ -175,7 +177,8 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), - 0, 0, + 0, + Q_NULLPTR, reason, uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -187,9 +190,9 @@ int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMin QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - 0, 0, + Q_NULLPTR, Q_NULLPTR, - 0, + Q_NULLPTR, metaObjectRevision }; @@ -213,7 +216,8 @@ int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int ve qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), - 0, 0, + 0, + Q_NULLPTR, reason, uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject, @@ -227,7 +231,7 @@ int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int ve QQmlPrivate::createParent<E>, &E::staticMetaObject, - 0, + Q_NULLPTR, 0 }; @@ -256,9 +260,9 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - 0, 0, + Q_NULLPTR, Q_NULLPTR, - 0, + Q_NULLPTR, 0 }; @@ -287,9 +291,9 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - 0, 0, + Q_NULLPTR, Q_NULLPTR, - 0, + Q_NULLPTR, metaObjectRevision }; @@ -318,9 +322,9 @@ int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor) QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - 0, 0, + Q_NULLPTR, Q_NULLPTR, - 0, + Q_NULLPTR, metaObjectRevision }; @@ -338,10 +342,11 @@ int qmlRegisterExtendedType() qRegisterNormalizedMetaType<T *>(pointerName.constData()), qRegisterNormalizedMetaType<QQmlListProperty<T> >(listName.constData()), - 0, 0, + 0, + Q_NULLPTR, QString(), - 0, 0, 0, 0, &T::staticMetaObject, + Q_NULLPTR, 0, 0, Q_NULLPTR, &T::staticMetaObject, QQmlPrivate::attachedPropertiesFunc<T>(), QQmlPrivate::attachedPropertiesMetaObject<T>(), @@ -352,7 +357,7 @@ int qmlRegisterExtendedType() QQmlPrivate::createParent<E>, &E::staticMetaObject, - 0, + Q_NULLPTR, 0 }; @@ -391,7 +396,7 @@ int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor, QQmlPrivate::createParent<E>, &E::staticMetaObject, - 0, + Q_NULLPTR, 0 }; @@ -441,7 +446,7 @@ int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor, QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(), QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(), - 0, 0, + Q_NULLPTR, Q_NULLPTR, parser, 0 @@ -536,7 +541,7 @@ inline int qmlRegisterSingletonType(const char *uri, int versionMajor, int versi uri, versionMajor, versionMinor, typeName, - callback, 0, 0, 0, 0 + callback, Q_NULLPTR, Q_NULLPTR, 0, 0 }; return QQmlPrivate::qmlregister(QQmlPrivate::SingletonRegistration, &api); @@ -554,7 +559,7 @@ inline int qmlRegisterSingletonType(const char *uri, int versionMajor, int versi uri, versionMajor, versionMinor, typeName, - 0, callback, &T::staticMetaObject, qRegisterNormalizedMetaType<T *>(pointerName.constData()), 0 + Q_NULLPTR, callback, &T::staticMetaObject, qRegisterNormalizedMetaType<T *>(pointerName.constData()), 0 }; return QQmlPrivate::qmlregister(QQmlPrivate::SingletonRegistration, &api); diff --git a/src/qml/qml/qqmlapplicationengine.h b/src/qml/qml/qqmlapplicationengine.h index 59667a1841..ff7dce5f8b 100644 --- a/src/qml/qml/qqmlapplicationengine.h +++ b/src/qml/qml/qqmlapplicationengine.h @@ -53,9 +53,9 @@ class Q_QML_EXPORT QQmlApplicationEngine : public QQmlEngine { Q_OBJECT public: - QQmlApplicationEngine(QObject *parent=0); - QQmlApplicationEngine(const QUrl &url, QObject *parent=0); - QQmlApplicationEngine(const QString &filePath, QObject *parent=0); + QQmlApplicationEngine(QObject *parent = Q_NULLPTR); + QQmlApplicationEngine(const QUrl &url, QObject *parent = Q_NULLPTR); + QQmlApplicationEngine(const QString &filePath, QObject *parent = Q_NULLPTR); ~QQmlApplicationEngine(); QList<QObject*> rootObjects(); diff --git a/src/qml/qml/qqmlcomponent.h b/src/qml/qml/qqmlcomponent.h index 0e226320d6..aefbf20aff 100644 --- a/src/qml/qml/qqmlcomponent.h +++ b/src/qml/qml/qqmlcomponent.h @@ -72,12 +72,12 @@ public: enum CompilationMode { PreferSynchronous, Asynchronous }; Q_ENUM(CompilationMode) - QQmlComponent(QObject *parent = 0); - QQmlComponent(QQmlEngine *, QObject *parent=0); - QQmlComponent(QQmlEngine *, const QString &fileName, QObject *parent = 0); - QQmlComponent(QQmlEngine *, const QString &fileName, CompilationMode mode, QObject *parent = 0); - QQmlComponent(QQmlEngine *, const QUrl &url, QObject *parent = 0); - QQmlComponent(QQmlEngine *, const QUrl &url, CompilationMode mode, QObject *parent = 0); + QQmlComponent(QObject *parent = Q_NULLPTR); + QQmlComponent(QQmlEngine *, QObject *parent = Q_NULLPTR); + QQmlComponent(QQmlEngine *, const QString &fileName, QObject *parent = Q_NULLPTR); + QQmlComponent(QQmlEngine *, const QString &fileName, CompilationMode mode, QObject *parent = Q_NULLPTR); + QQmlComponent(QQmlEngine *, const QUrl &url, QObject *parent = Q_NULLPTR); + QQmlComponent(QQmlEngine *, const QUrl &url, CompilationMode mode, QObject *parent = Q_NULLPTR); virtual ~QQmlComponent(); enum Status { Null, Ready, Loading, Error }; @@ -96,12 +96,12 @@ public: QUrl url() const; - virtual QObject *create(QQmlContext *context = 0); + virtual QObject *create(QQmlContext *context = Q_NULLPTR); virtual QObject *beginCreate(QQmlContext *); virtual void completeCreate(); - void create(QQmlIncubator &, QQmlContext *context = 0, - QQmlContext *forContext = 0); + void create(QQmlIncubator &, QQmlContext *context = Q_NULLPTR, + QQmlContext *forContext = Q_NULLPTR); QQmlContext *creationContext() const; diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp index f759f46af5..65a337f4e5 100644 --- a/src/qml/qml/qqmlcontext.cpp +++ b/src/qml/qml/qqmlcontext.cpp @@ -95,7 +95,7 @@ QQmlContextPrivate::QQmlContextPrivate() by name in the context, as though they were all individually added through calls to QQmlContext::setContextProperty(). Changes to the property's values are detected through the property's notify signal. Setting a context object is both - faster and easier than manually adding and maintaing context property values. + faster and easier than manually adding and maintaining context property values. The following example has the same effect as the previous one, but it uses a context object. diff --git a/src/qml/qml/qqmlcontext.h b/src/qml/qml/qqmlcontext.h index c6b5d44f5a..781eac44fc 100644 --- a/src/qml/qml/qqmlcontext.h +++ b/src/qml/qml/qqmlcontext.h @@ -62,8 +62,8 @@ class Q_QML_EXPORT QQmlContext : public QObject Q_DECLARE_PRIVATE(QQmlContext) public: - QQmlContext(QQmlEngine *parent, QObject *objParent=0); - QQmlContext(QQmlContext *parent, QObject *objParent=0); + QQmlContext(QQmlEngine *parent, QObject *objParent = Q_NULLPTR); + QQmlContext(QQmlContext *parent, QObject *objParent = Q_NULLPTR); virtual ~QQmlContext(); bool isValid() const; diff --git a/src/qml/qml/qqmlengine.h b/src/qml/qml/qqmlengine.h index a7eda0ee6c..bd2a3cfc48 100644 --- a/src/qml/qml/qqmlengine.h +++ b/src/qml/qml/qqmlengine.h @@ -95,7 +95,7 @@ class Q_QML_EXPORT QQmlEngine : public QJSEngine Q_PROPERTY(QString offlineStoragePath READ offlineStoragePath WRITE setOfflineStoragePath) Q_OBJECT public: - QQmlEngine(QObject *p = 0); + explicit QQmlEngine(QObject *p = Q_NULLPTR); virtual ~QQmlEngine(); QQmlContext *rootContext() const; diff --git a/src/qml/qml/qqmlexpression.h b/src/qml/qml/qqmlexpression.h index 0aff4884f9..5239d59c8a 100644 --- a/src/qml/qml/qqmlexpression.h +++ b/src/qml/qml/qqmlexpression.h @@ -60,8 +60,8 @@ class Q_QML_EXPORT QQmlExpression : public QObject Q_OBJECT public: QQmlExpression(); - QQmlExpression(QQmlContext *, QObject *, const QString &, QObject * = 0); - explicit QQmlExpression(const QQmlScriptString &, QQmlContext * = 0, QObject * = 0, QObject * = 0); + QQmlExpression(QQmlContext *, QObject *, const QString &, QObject * = Q_NULLPTR); + explicit QQmlExpression(const QQmlScriptString &, QQmlContext * = Q_NULLPTR, QObject * = Q_NULLPTR, QObject * = Q_NULLPTR); virtual ~QQmlExpression(); QQmlEngine *engine() const; @@ -84,7 +84,7 @@ public: void clearError(); QQmlError error() const; - QVariant evaluate(bool *valueIsUndefined = 0); + QVariant evaluate(bool *valueIsUndefined = Q_NULLPTR); Q_SIGNALS: void valueChanged(); diff --git a/src/qml/qml/qqmlextensionplugin.h b/src/qml/qml/qqmlextensionplugin.h index d0ee16ac50..de482d0352 100644 --- a/src/qml/qml/qqmlextensionplugin.h +++ b/src/qml/qml/qqmlextensionplugin.h @@ -58,7 +58,7 @@ class Q_QML_EXPORT QQmlExtensionPlugin Q_INTERFACES(QQmlExtensionInterface) Q_INTERFACES(QQmlTypesExtensionInterface) public: - explicit QQmlExtensionPlugin(QObject *parent = 0); + explicit QQmlExtensionPlugin(QObject *parent = Q_NULLPTR); ~QQmlExtensionPlugin(); QUrl baseUrl() const; diff --git a/src/qml/qml/qqmlfileselector.h b/src/qml/qml/qqmlfileselector.h index 34ba4d7a56..03b951420e 100644 --- a/src/qml/qml/qqmlfileselector.h +++ b/src/qml/qml/qqmlfileselector.h @@ -54,7 +54,7 @@ class Q_QML_EXPORT QQmlFileSelector : public QObject Q_OBJECT Q_DECLARE_PRIVATE(QQmlFileSelector) public: - QQmlFileSelector(QQmlEngine* engine, QObject* parent=0); + explicit QQmlFileSelector(QQmlEngine *engine, QObject *parent = Q_NULLPTR); ~QQmlFileSelector(); QFileSelector *selector() const Q_DECL_NOTHROW; void setSelector(QFileSelector *selector); diff --git a/src/qml/qml/qqmllist.h b/src/qml/qml/qqmllist.h index dd548168c3..e3955deee5 100644 --- a/src/qml/qml/qqmllist.h +++ b/src/qml/qml/qqmllist.h @@ -61,15 +61,41 @@ public: typedef void (*ClearFunction)(QQmlListProperty<T> *); QQmlListProperty() - : object(0), data(0), append(0), count(0), at(0), clear(0), dummy1(0), dummy2(0) {} + : object(Q_NULLPTR), + data(Q_NULLPTR), + append(Q_NULLPTR), + count(Q_NULLPTR), + at(Q_NULLPTR), + clear(Q_NULLPTR), + dummy1(Q_NULLPTR), + dummy2(Q_NULLPTR) + {} QQmlListProperty(QObject *o, QList<T *> &list) : object(o), data(&list), append(qlist_append), count(qlist_count), at(qlist_at), - clear(qlist_clear), dummy1(0), dummy2(0) {} + clear(qlist_clear), + dummy1(Q_NULLPTR), + dummy2(Q_NULLPTR) + {} QQmlListProperty(QObject *o, void *d, AppendFunction a, CountFunction c, AtFunction t, ClearFunction r ) - : object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(0), dummy2(0) {} + : object(o), + data(d), + append(a), + count(c), + at(t), + clear(r), + dummy1(Q_NULLPTR), + dummy2(Q_NULLPTR) + {} QQmlListProperty(QObject *o, void *d, CountFunction c, AtFunction t) - : object(o), data(d), append(0), count(c), at(t), clear(0), dummy1(0), dummy2(0) {} + : object(o), + data(d), + append(Q_NULLPTR), + count(c), at(t), + clear(Q_NULLPTR), + dummy1(Q_NULLPTR), + dummy2(Q_NULLPTR) + {} bool operator==(const QQmlListProperty &o) const { return object == o.object && data == o.data && @@ -114,7 +140,7 @@ class Q_QML_EXPORT QQmlListReference { public: QQmlListReference(); - QQmlListReference(QObject *, const char *property, QQmlEngine * = 0); + QQmlListReference(QObject *, const char *property, QQmlEngine * = Q_NULLPTR); QQmlListReference(const QQmlListReference &); QQmlListReference &operator=(const QQmlListReference &); ~QQmlListReference(); diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 1a7896bde8..29fff04325 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -716,6 +716,8 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con QQmlTypeNameCache::Result res = context->imports->query(stringAt(binding->propertyNameIndex)); if (res.isValid()) attachedType = res.type; + else + return false; } const int id = attachedType->attachedPropertiesId(QQmlEnginePrivate::get(engine)); QObject *qmlObject = qmlAttachedPropertiesObjectById(id, _qobject); diff --git a/src/qml/types/qqmllistmodelworkeragent_p.h b/src/qml/types/qqmllistmodelworkeragent_p.h index 0c639b140d..f9872a6ad4 100644 --- a/src/qml/types/qqmllistmodelworkeragent_p.h +++ b/src/qml/types/qqmllistmodelworkeragent_p.h @@ -97,7 +97,8 @@ public: VariantRef &operator=(const VariantRef &o) { if (o.a) o.a->addref(); - if (a) a->release(); a = o.a; + if (a) a->release(); + a = o.a; return *this; } diff --git a/src/qml/util/qqmlpropertymap.h b/src/qml/util/qqmlpropertymap.h index ea1561bc60..01048f3662 100644 --- a/src/qml/util/qqmlpropertymap.h +++ b/src/qml/util/qqmlpropertymap.h @@ -55,7 +55,7 @@ class Q_QML_EXPORT QQmlPropertyMap : public QObject { Q_OBJECT public: - explicit QQmlPropertyMap(QObject *parent = 0); + explicit QQmlPropertyMap(QObject *parent = Q_NULLPTR); virtual ~QQmlPropertyMap(); QVariant value(const QString &key) const; |