aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/shapes
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/imports/shapes
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/imports/shapes')
-rw-r--r--src/imports/shapes/plugin.cpp2
-rw-r--r--src/imports/shapes/qquickshapegenericrenderer.cpp6
-rw-r--r--src/imports/shapes/qquickshapenvprrenderer.cpp2
-rw-r--r--src/imports/shapes/qquickshapesoftwarerenderer.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/imports/shapes/plugin.cpp b/src/imports/shapes/plugin.cpp
index 74731aa35f..f0e66479b6 100644
--- a/src/imports/shapes/plugin.cpp
+++ b/src/imports/shapes/plugin.cpp
@@ -58,7 +58,7 @@ class QmlShapesPlugin : public QQmlExtensionPlugin
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
- QmlShapesPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { initResources(); }
+ QmlShapesPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { initResources(); }
void registerTypes(const char *uri) override
{
Q_ASSERT(QByteArray(uri) == QByteArray("QtQuick.Shapes"));
diff --git a/src/imports/shapes/qquickshapegenericrenderer.cpp b/src/imports/shapes/qquickshapegenericrenderer.cpp
index 8131f02f1a..411252a906 100644
--- a/src/imports/shapes/qquickshapegenericrenderer.cpp
+++ b/src/imports/shapes/qquickshapegenericrenderer.cpp
@@ -448,14 +448,14 @@ void QQuickShapeGenericRenderer::triangulateStroke(const QPainterPath &path,
stroker.setInvScale(inverseScale);
if (pen.style() == Qt::SolidLine) {
- stroker.process(vp, pen, clip, 0);
+ stroker.process(vp, pen, clip, nullptr);
} else {
QDashedStrokeProcessor dashStroker;
dashStroker.setInvScale(inverseScale);
- dashStroker.process(vp, pen, clip, 0);
+ dashStroker.process(vp, pen, clip, nullptr);
QVectorPath dashStroke(dashStroker.points(), dashStroker.elementCount(),
dashStroker.elementTypes(), 0);
- stroker.process(dashStroke, pen, clip, 0);
+ stroker.process(dashStroke, pen, clip, nullptr);
}
if (!stroker.vertexCount()) {
diff --git a/src/imports/shapes/qquickshapenvprrenderer.cpp b/src/imports/shapes/qquickshapenvprrenderer.cpp
index 88f367fe70..51af0d8961 100644
--- a/src/imports/shapes/qquickshapenvprrenderer.cpp
+++ b/src/imports/shapes/qquickshapenvprrenderer.cpp
@@ -986,7 +986,7 @@ void QQuickNvprBlitter::texturedQuad(GLuint textureId, const QSize &size,
m_program->enableAttributeArray(0);
m_program->enableAttributeArray(1);
- f->glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), 0);
+ f->glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), nullptr);
f->glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), (const void *) (2 * sizeof(GLfloat)));
f->glBindTexture(GL_TEXTURE_2D, textureId);
diff --git a/src/imports/shapes/qquickshapesoftwarerenderer.cpp b/src/imports/shapes/qquickshapesoftwarerenderer.cpp
index ed13afbc7e..0f5c3604b5 100644
--- a/src/imports/shapes/qquickshapesoftwarerenderer.cpp
+++ b/src/imports/shapes/qquickshapesoftwarerenderer.cpp
@@ -266,7 +266,7 @@ void QQuickShapeSoftwareRenderNode::render(const RenderState *state)
QSGRenderNode::StateFlags QQuickShapeSoftwareRenderNode::changedStates() const
{
- return 0;
+ return nullptr;
}
QSGRenderNode::RenderingFlags QQuickShapeSoftwareRenderNode::flags() const