aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-03-03 10:45:35 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-03-03 11:41:39 +0000
commit0e0c351fff752ceadc99eef5fbcf5a180f453efc (patch)
treed722e7a29e7b7af9ecf8ceddf18a1efcc8d75d4e /src/qml
parent8a99d2e11b1d4971faa489cef626b70a7d828d17 (diff)
Make public headers compile with -Wzero-as-null-pointer-constant
... or equivalent. QtBase 5.6 headers already compile that way, so let the other modules follow suit. Task-number: QTBUG-45291 Change-Id: Ied526fb2d7adc3a68946d6843a6bd6f475ebf864 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/jsapi/qjsengine.h2
-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.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/util/qqmlpropertymap.h2
11 files changed, 83 insertions, 52 deletions
diff --git a/src/qml/jsapi/qjsengine.h b/src/qml/jsapi/qjsengine.h
index 40b0a60369..c3f3ace1dd 100644
--- a/src/qml/jsapi/qjsengine.h
+++ b/src/qml/jsapi/qjsengine.h
@@ -105,7 +105,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/qml/qqml.h b/src/qml/qml/qqml.h
index 23cb69e2f1..02618f77f5 100644
--- a/src/qml/qml/qqml.h
+++ b/src/qml/qml/qqml.h
@@ -105,10 +105,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>(),
@@ -117,9 +118,9 @@ int qmlRegisterType()
QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueSource>::cast(),
QQmlPrivate::StaticCastSelector<T,QQmlPropertyValueInterceptor>::cast(),
- 0, 0,
+ Q_NULLPTR, Q_NULLPTR,
- 0,
+ Q_NULLPTR,
0
};
@@ -138,7 +139,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,
@@ -150,9 +152,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
};
@@ -169,7 +171,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,
@@ -181,9 +184,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
};
@@ -207,7 +210,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,
@@ -221,7 +225,7 @@ int qmlRegisterExtendedUncreatableType(const char *uri, int versionMajor, int ve
QQmlPrivate::createParent<E>, &E::staticMetaObject,
- 0,
+ Q_NULLPTR,
0
};
@@ -250,9 +254,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
};
@@ -281,9 +285,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
};
@@ -312,9 +316,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
};
@@ -332,10 +336,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>(),
@@ -346,7 +351,7 @@ int qmlRegisterExtendedType()
QQmlPrivate::createParent<E>, &E::staticMetaObject,
- 0,
+ Q_NULLPTR,
0
};
@@ -385,7 +390,7 @@ int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor,
QQmlPrivate::createParent<E>, &E::staticMetaObject,
- 0,
+ Q_NULLPTR,
0
};
@@ -435,7 +440,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
@@ -530,7 +535,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);
@@ -548,7 +553,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 84cb2625dc..3b91d6adfc 100644
--- a/src/qml/qml/qqmlapplicationengine.h
+++ b/src/qml/qml/qqmlapplicationengine.h
@@ -47,9 +47,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 121c83db5c..58cbadff00 100644
--- a/src/qml/qml/qqmlcomponent.h
+++ b/src/qml/qml/qqmlcomponent.h
@@ -66,12 +66,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 };
@@ -90,12 +90,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.h b/src/qml/qml/qqmlcontext.h
index e69a2f8f69..3049ec7f71 100644
--- a/src/qml/qml/qqmlcontext.h
+++ b/src/qml/qml/qqmlcontext.h
@@ -56,8 +56,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 61a884279d..a0d47c33a6 100644
--- a/src/qml/qml/qqmlengine.h
+++ b/src/qml/qml/qqmlengine.h
@@ -88,7 +88,7 @@ class Q_QML_EXPORT QQmlEngine : public QJSEngine
Q_PROPERTY(QString offlineStoragePath READ offlineStoragePath WRITE setOfflineStoragePath)
Q_OBJECT
public:
- QQmlEngine(QObject *p = 0);
+ 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 408871cfc5..e3e96f8030 100644
--- a/src/qml/qml/qqmlexpression.h
+++ b/src/qml/qml/qqmlexpression.h
@@ -54,8 +54,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;
@@ -78,7 +78,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 879cc91abe..074b5e2531 100644
--- a/src/qml/qml/qqmlextensionplugin.h
+++ b/src/qml/qml/qqmlextensionplugin.h
@@ -52,7 +52,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 d86908e9cb..3af63a8293 100644
--- a/src/qml/qml/qqmlfileselector.h
+++ b/src/qml/qml/qqmlfileselector.h
@@ -48,7 +48,7 @@ class Q_QML_EXPORT QQmlFileSelector : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QQmlFileSelector)
public:
- QQmlFileSelector(QQmlEngine* engine, QObject* parent=0);
+ QQmlFileSelector(QQmlEngine *engine, QObject *parent = Q_NULLPTR);
~QQmlFileSelector();
void setSelector(QFileSelector *selector);
void setExtraSelectors(QStringList &strings); // TODO Qt6: remove
diff --git a/src/qml/qml/qqmllist.h b/src/qml/qml/qqmllist.h
index edd61b26c9..5a06299f3b 100644
--- a/src/qml/qml/qqmllist.h
+++ b/src/qml/qml/qqmllist.h
@@ -55,15 +55,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 &&
@@ -108,7 +134,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/util/qqmlpropertymap.h b/src/qml/util/qqmlpropertymap.h
index 685f771452..028a299eec 100644
--- a/src/qml/util/qqmlpropertymap.h
+++ b/src/qml/util/qqmlpropertymap.h
@@ -49,7 +49,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;