aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickopenglshadereffect.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-21 10:41:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-26 07:13:18 +0000
commit499ec43937e926e4f2fa57a9baa455fcb3862262 (patch)
tree206c90d47387f8322b68f5e3db613189397e1af3 /src/quick/items/qquickopenglshadereffect.cpp
parent53d1e9ed21d25e65a2f13606af479838f5f21fe7 (diff)
use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/items/qquickopenglshadereffect.cpp')
-rw-r--r--src/quick/items/qquickopenglshadereffect.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/quick/items/qquickopenglshadereffect.cpp b/src/quick/items/qquickopenglshadereffect.cpp
index 3194aa3cd0..cad598d2c0 100644
--- a/src/quick/items/qquickopenglshadereffect.cpp
+++ b/src/quick/items/qquickopenglshadereffect.cpp
@@ -484,7 +484,7 @@ void QQuickOpenGLShaderEffectCommon::updateMaterial(QQuickOpenGLShaderEffectNode
if (d.specialType != UniformData::Sampler && d.specialType != UniformData::SamplerExternal)
continue;
QSGTextureProvider *oldProvider = material->textureProviders.at(index);
- QSGTextureProvider *newProvider = 0;
+ QSGTextureProvider *newProvider = nullptr;
QQuickItem *source = qobject_cast<QQuickItem *>(qvariant_cast<QObject *>(d.value));
if (source && source->isTextureProvider())
newProvider = source->textureProvider();
@@ -624,7 +624,7 @@ QQuickOpenGLShaderEffect::QQuickOpenGLShaderEffect(QQuickShaderEffect *item, QOb
, m_item(item)
, m_itemMetaObject(nullptr)
, m_meshResolution(1, 1)
- , m_mesh(0)
+ , m_mesh(nullptr)
, m_cullMode(QQuickShaderEffect::NoCulling)
, m_status(QQuickShaderEffect::Uncompiled)
, m_common(this, [this](int mappedId){this->propertyChanged(mappedId);})
@@ -713,7 +713,7 @@ void QQuickOpenGLShaderEffect::setMesh(const QVariant &mesh)
if (newMesh && newMesh == m_mesh)
return;
if (m_mesh)
- disconnect(m_mesh, SIGNAL(geometryChanged()), this, 0);
+ disconnect(m_mesh, SIGNAL(geometryChanged()), this, nullptr);
m_mesh = newMesh;
if (m_mesh) {
connect(m_mesh, SIGNAL(geometryChanged()), this, SLOT(updateGeometry()));
@@ -766,7 +766,7 @@ QString QQuickOpenGLShaderEffect::parseLog()
maybeUpdateShaders(true);
if (m_dirtyParseLog) {
- m_common.updateParseLog(m_mesh != 0);
+ m_common.updateParseLog(m_mesh != nullptr);
m_dirtyParseLog = false;
}
return m_common.parseLog;
@@ -838,7 +838,7 @@ QSGNode *QQuickOpenGLShaderEffect::handleUpdatePaintNode(QSGNode *oldNode, QQuic
if (m_common.attributes.isEmpty() || m_item->width() <= 0 || m_item->height() <= 0) {
if (node)
delete node;
- return 0;
+ return nullptr;
}
if (!node) {
@@ -914,7 +914,7 @@ QSGNode *QQuickOpenGLShaderEffect::handleUpdatePaintNode(QSGNode *oldNode, QQuic
}
if (m_dirtyMesh) {
- node->setGeometry(0);
+ node->setGeometry(nullptr);
m_dirtyMesh = false;
m_dirtyGeometry = true;
}
@@ -935,7 +935,7 @@ QSGNode *QQuickOpenGLShaderEffect::handleUpdatePaintNode(QSGNode *oldNode, QQuic
emit m_item->statusChanged();
}
delete node;
- return 0;
+ return nullptr;
}
geometry = mesh->updateGeometry(geometry, m_common.attributes.count(), posIndex, srcRect, rect);