QtOpenGL: 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: I16c93bd36c242a6d402cf7622820e91eac782772 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
parent
861dca57d7
commit
db5e672acc
@ -235,7 +235,7 @@ public:
|
||||
QGLContext(const QGLFormat& format);
|
||||
virtual ~QGLContext();
|
||||
|
||||
virtual bool create(const QGLContext* shareContext = 0);
|
||||
virtual bool create(const QGLContext* shareContext = Q_NULLPTR);
|
||||
bool isValid() const;
|
||||
bool isSharing() const;
|
||||
void reset();
|
||||
@ -303,7 +303,7 @@ public:
|
||||
QOpenGLContext *contextHandle() const;
|
||||
|
||||
protected:
|
||||
virtual bool chooseContext(const QGLContext* shareContext = 0);
|
||||
virtual bool chooseContext(const QGLContext* shareContext = Q_NULLPTR);
|
||||
|
||||
bool deviceIsPixmap() const;
|
||||
bool windowCreated() const;
|
||||
@ -380,7 +380,7 @@ public:
|
||||
void setFormat(const QGLFormat& format);
|
||||
|
||||
QGLContext* context() const;
|
||||
void setContext(QGLContext* context, const QGLContext* shareContext = 0,
|
||||
void setContext(QGLContext* context, const QGLContext* shareContext = Q_NULLPTR,
|
||||
bool deleteOldContext = true);
|
||||
|
||||
QPixmap renderPixmap(int w = 0, int h = 0, bool useContext = false);
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
void write(int offset, const void *data, int count);
|
||||
|
||||
void allocate(const void *data, int count);
|
||||
inline void allocate(int count) { allocate(0, count); }
|
||||
inline void allocate(int count) { allocate(Q_NULLPTR, count); }
|
||||
|
||||
void *map(QGLBuffer::Access access);
|
||||
bool unmap();
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
int findNearest(QRgb color) const;
|
||||
|
||||
protected:
|
||||
Qt::HANDLE handle() { return d ? d->cmapHandle : 0; }
|
||||
Qt::HANDLE handle() { return d ? d->cmapHandle : Q_NULLPTR; }
|
||||
void setHandle(Qt::HANDLE ahandle) { d->cmapHandle = ahandle; }
|
||||
|
||||
private:
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
QGLFunctions::OpenGLFeatures openGLFeatures() const;
|
||||
bool hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const;
|
||||
|
||||
void initializeGLFunctions(const QGLContext *context = 0);
|
||||
void initializeGLFunctions(const QGLContext *context = Q_NULLPTR);
|
||||
|
||||
void glActiveTexture(GLenum texture);
|
||||
void glAttachShader(GLuint program, GLuint shader);
|
||||
@ -172,14 +172,14 @@ public:
|
||||
|
||||
private:
|
||||
QGLFunctionsPrivate *d_ptr;
|
||||
static bool isInitialized(const QGLFunctionsPrivate *d) { return d != 0; }
|
||||
static bool isInitialized(const QGLFunctionsPrivate *d) { return d != Q_NULLPTR; }
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFunctions::OpenGLFeatures)
|
||||
|
||||
struct QGLFunctionsPrivate
|
||||
{
|
||||
QGLFunctionsPrivate(const QGLContext *context = 0);
|
||||
QGLFunctionsPrivate(const QGLContext *context = Q_NULLPTR);
|
||||
QOpenGLFunctions *funcs;
|
||||
};
|
||||
|
||||
|
@ -47,9 +47,9 @@ class Q_OPENGL_EXPORT QGLPixelBuffer : public QPaintDevice
|
||||
Q_DECLARE_PRIVATE(QGLPixelBuffer)
|
||||
public:
|
||||
QGLPixelBuffer(const QSize &size, const QGLFormat &format = QGLFormat::defaultFormat(),
|
||||
QGLWidget *shareWidget = 0);
|
||||
QGLWidget *shareWidget = Q_NULLPTR);
|
||||
QGLPixelBuffer(int width, int height, const QGLFormat &format = QGLFormat::defaultFormat(),
|
||||
QGLWidget *shareWidget = 0);
|
||||
QGLWidget *shareWidget = Q_NULLPTR);
|
||||
virtual ~QGLPixelBuffer();
|
||||
|
||||
bool isValid() const;
|
||||
|
@ -58,8 +58,8 @@ public:
|
||||
};
|
||||
Q_DECLARE_FLAGS(ShaderType, ShaderTypeBit)
|
||||
|
||||
explicit QGLShader(QGLShader::ShaderType type, QObject *parent = 0);
|
||||
QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = 0);
|
||||
explicit QGLShader(QGLShader::ShaderType type, QObject *parent = Q_NULLPTR);
|
||||
QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = Q_NULLPTR);
|
||||
virtual ~QGLShader();
|
||||
|
||||
QGLShader::ShaderType shaderType() const;
|
||||
@ -76,7 +76,7 @@ public:
|
||||
|
||||
GLuint shaderId() const;
|
||||
|
||||
static bool hasOpenGLShaders(ShaderType type, const QGLContext *context = 0);
|
||||
static bool hasOpenGLShaders(ShaderType type, const QGLContext *context = Q_NULLPTR);
|
||||
|
||||
private:
|
||||
friend class QGLShaderProgram;
|
||||
@ -94,8 +94,8 @@ class Q_OPENGL_EXPORT QGLShaderProgram : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QGLShaderProgram(QObject *parent = 0);
|
||||
explicit QGLShaderProgram(const QGLContext *context, QObject *parent = 0);
|
||||
explicit QGLShaderProgram(QObject *parent = Q_NULLPTR);
|
||||
explicit QGLShaderProgram(const QGLContext *context, QObject *parent = Q_NULLPTR);
|
||||
virtual ~QGLShaderProgram();
|
||||
|
||||
bool addShader(QGLShader *shader);
|
||||
@ -280,7 +280,7 @@ public:
|
||||
void setUniformValueArray(const char *name, const QMatrix4x3 *values, int count);
|
||||
void setUniformValueArray(const char *name, const QMatrix4x4 *values, int count);
|
||||
|
||||
static bool hasOpenGLShaderPrograms(const QGLContext *context = 0);
|
||||
static bool hasOpenGLShaderPrograms(const QGLContext *context = Q_NULLPTR);
|
||||
|
||||
private Q_SLOTS:
|
||||
void shaderDestroyed();
|
||||
|
Loading…
Reference in New Issue
Block a user