From a767014167d4f7b258a2bd83637dc1ef25b364f0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 30 Jun 2015 22:11:15 +0200 Subject: QtGui: Use Q_NULLPTR instead of 0 in all public headers This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I72ab40b21a9499b53a639564fa45884de17b6c98 Reviewed-by: Thiago Macieira --- src/gui/image/qbitmap.h | 2 +- src/gui/image/qiconengineplugin.h | 2 +- src/gui/image/qimage.h | 24 ++++++++++++------------ src/gui/image/qimageiohandler.h | 2 +- src/gui/image/qmovie.h | 6 +++--- src/gui/image/qpicture.h | 8 ++++---- src/gui/image/qpictureformatplugin.h | 2 +- src/gui/image/qpixmap.h | 16 ++++++++-------- 8 files changed, 31 insertions(+), 31 deletions(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qbitmap.h b/src/gui/image/qbitmap.h index f3ad90be20..be693af1cf 100644 --- a/src/gui/image/qbitmap.h +++ b/src/gui/image/qbitmap.h @@ -48,7 +48,7 @@ public: QBitmap(const QPixmap &); QBitmap(int w, int h); explicit QBitmap(const QSize &); - explicit QBitmap(const QString &fileName, const char *format=0); + explicit QBitmap(const QString &fileName, const char *format = Q_NULLPTR); ~QBitmap(); QBitmap &operator=(const QPixmap &); diff --git a/src/gui/image/qiconengineplugin.h b/src/gui/image/qiconengineplugin.h index 66684c871d..b05969f283 100644 --- a/src/gui/image/qiconengineplugin.h +++ b/src/gui/image/qiconengineplugin.h @@ -48,7 +48,7 @@ class Q_GUI_EXPORT QIconEnginePlugin : public QObject { Q_OBJECT public: - QIconEnginePlugin(QObject *parent = 0); + QIconEnginePlugin(QObject *parent = Q_NULLPTR); ~QIconEnginePlugin(); virtual QIconEngine *create(const QString &filename = QString()) = 0; diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 26707021ea..888c7beb32 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -125,15 +125,15 @@ public: QImage() Q_DECL_NOEXCEPT; QImage(const QSize &size, Format format); QImage(int width, int height, Format format); - QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0); - QImage(const uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0); - QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0); - QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0); + QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR); + QImage(const uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR); + QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR); + QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR); #ifndef QT_NO_IMAGEFORMAT_XPM explicit QImage(const char * const xpm[]); #endif - explicit QImage(const QString &fileName, const char *format = 0); + explicit QImage(const QString &fileName, const char *format = Q_NULLPTR); QImage(const QImage &); #ifdef Q_COMPILER_RVALUE_REFS @@ -279,16 +279,16 @@ public: bool load(QIODevice *device, const char* format); - bool load(const QString &fileName, const char* format=0); - bool loadFromData(const uchar *buf, int len, const char *format = 0); - inline bool loadFromData(const QByteArray &data, const char* aformat=0) + bool load(const QString &fileName, const char *format = Q_NULLPTR); + bool loadFromData(const uchar *buf, int len, const char *format = Q_NULLPTR); + inline bool loadFromData(const QByteArray &data, const char *aformat = Q_NULLPTR) { return loadFromData(reinterpret_cast(data.constData()), data.size(), aformat); } - bool save(const QString &fileName, const char* format=0, int quality=-1) const; - bool save(QIODevice *device, const char* format=0, int quality=-1) const; + bool save(const QString &fileName, const char *format = Q_NULLPTR, int quality = -1) const; + bool save(QIODevice *device, const char *format = Q_NULLPTR, int quality = -1) const; - static QImage fromData(const uchar *data, int size, const char *format = 0); - inline static QImage fromData(const QByteArray &data, const char *format = 0) + static QImage fromData(const uchar *data, int size, const char *format = Q_NULLPTR); + inline static QImage fromData(const QByteArray &data, const char *format = Q_NULLPTR) { return fromData(reinterpret_cast(data.constData()), data.size(), format); } #if QT_DEPRECATED_SINCE(5, 0) diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h index 80cd87c4c3..47a8a2b7c6 100644 --- a/src/gui/image/qimageiohandler.h +++ b/src/gui/image/qimageiohandler.h @@ -133,7 +133,7 @@ class Q_GUI_EXPORT QImageIOPlugin : public QObject { Q_OBJECT public: - explicit QImageIOPlugin(QObject *parent = 0); + explicit QImageIOPlugin(QObject *parent = Q_NULLPTR); virtual ~QImageIOPlugin(); enum Capability { diff --git a/src/gui/image/qmovie.h b/src/gui/image/qmovie.h index 13bc381f8e..a750e4a9fc 100644 --- a/src/gui/image/qmovie.h +++ b/src/gui/image/qmovie.h @@ -73,9 +73,9 @@ public: }; Q_ENUM(CacheMode) - explicit QMovie(QObject *parent = 0); - explicit QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent = 0); - explicit QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent = 0); + explicit QMovie(QObject *parent = Q_NULLPTR); + explicit QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent = Q_NULLPTR); + explicit QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent = Q_NULLPTR); ~QMovie(); static QList supportedFormats(); diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h index c3897a1935..a71d1deb02 100644 --- a/src/gui/image/qpicture.h +++ b/src/gui/image/qpicture.h @@ -62,10 +62,10 @@ public: bool play(QPainter *p); - bool load(QIODevice *dev, const char *format = 0); - bool load(const QString &fileName, const char *format = 0); - bool save(QIODevice *dev, const char *format = 0); - bool save(const QString &fileName, const char *format = 0); + bool load(QIODevice *dev, const char *format = Q_NULLPTR); + bool load(const QString &fileName, const char *format = Q_NULLPTR); + bool save(QIODevice *dev, const char *format = Q_NULLPTR); + bool save(const QString &fileName, const char *format = Q_NULLPTR); QRect boundingRect() const; void setBoundingRect(const QRect &r); diff --git a/src/gui/image/qpictureformatplugin.h b/src/gui/image/qpictureformatplugin.h index 773c0180d3..9ad938fa79 100644 --- a/src/gui/image/qpictureformatplugin.h +++ b/src/gui/image/qpictureformatplugin.h @@ -53,7 +53,7 @@ class Q_GUI_EXPORT QPictureFormatPlugin : public QObject { Q_OBJECT public: - explicit QPictureFormatPlugin(QObject *parent = 0); + explicit QPictureFormatPlugin(QObject *parent = Q_NULLPTR); ~QPictureFormatPlugin(); virtual bool loadPicture(const QString &format, const QString &filename, QPicture *pic); diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index 51b02acfcf..48db7a3840 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -58,7 +58,7 @@ public: explicit QPixmap(QPlatformPixmap *data); QPixmap(int w, int h); explicit QPixmap(const QSize &); - QPixmap(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor); + QPixmap(const QString& fileName, const char *format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor); #ifndef QT_NO_IMAGEFORMAT_XPM explicit QPixmap(const char * const xpm[]); #endif @@ -131,19 +131,19 @@ public: } #endif - bool load(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor); - bool loadFromData(const uchar *buf, uint len, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor); - inline bool loadFromData(const QByteArray &data, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor); - bool save(const QString& fileName, const char* format = 0, int quality = -1) const; - bool save(QIODevice* device, const char* format = 0, int quality = -1) const; + bool load(const QString& fileName, const char *format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor); + bool loadFromData(const uchar *buf, uint len, const char* format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor); + inline bool loadFromData(const QByteArray &data, const char* format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor); + bool save(const QString& fileName, const char* format = Q_NULLPTR, int quality = -1) const; + bool save(QIODevice* device, const char* format = Q_NULLPTR, int quality = -1) const; bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor); inline QPixmap copy(int x, int y, int width, int height) const; QPixmap copy(const QRect &rect = QRect()) const; - inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = 0); - void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = 0); + inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = Q_NULLPTR); + void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = Q_NULLPTR); #if QT_DEPRECATED_SINCE(5, 0) QT_DEPRECATED inline int serialNumber() const { return cacheKey() >> 32; } -- cgit v1.2.3