aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-03-07 19:31:56 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-03-07 19:31:57 +0100
commitb8fd0ed3a47558b4ace480526cddffa51d6f0580 (patch)
tree926095da42e111933bdb3a63c1a9e0a14fa4041f /src/qml/qml
parent669c554516736a6735b7286039c56cc0e8d56e05 (diff)
parent443ba99b1ef825e198fe1999c34ee44547135797 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqml.h55
-rw-r--r--src/qml/qml/qqmlapplicationengine.h6
-rw-r--r--src/qml/qml/qqmlcomponent.h18
-rw-r--r--src/qml/qml/qqmlcontext.cpp2
-rw-r--r--src/qml/qml/qqmlcontext.h4
-rw-r--r--src/qml/qml/qqmlengine.h2
-rw-r--r--src/qml/qml/qqmlexpression.h6
-rw-r--r--src/qml/qml/qqmlextensionplugin.h2
-rw-r--r--src/qml/qml/qqmlfileselector.h2
-rw-r--r--src/qml/qml/qqmllist.h36
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp2
11 files changed, 84 insertions, 51 deletions
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);