aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/textureprovider
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 /examples/quick/textureprovider
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 'examples/quick/textureprovider')
-rw-r--r--examples/quick/textureprovider/etcprovider.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/quick/textureprovider/etcprovider.cpp b/examples/quick/textureprovider/etcprovider.cpp
index de8eb12366..01a3f69be3 100644
--- a/examples/quick/textureprovider/etcprovider.cpp
+++ b/examples/quick/textureprovider/etcprovider.cpp
@@ -137,7 +137,7 @@ void EtcTexture::bind()
#endif
QOpenGLContext *ctx = QOpenGLContext::currentContext();
- Q_ASSERT(ctx != 0);
+ Q_ASSERT(ctx != nullptr);
ctx->functions()->glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_ETC1_RGB8_OES,
m_size.width(), m_size.height(), 0,
(m_paddedSize.width() * m_paddedSize.height()) >> 1,
@@ -181,7 +181,7 @@ public:
QQuickTextureFactory *EtcProvider::requestTexture(const QString &id, QSize *size, const QSize &requestedSize)
{
Q_UNUSED(requestedSize);
- QEtcTextureFactory *ret = 0;
+ QEtcTextureFactory *ret = nullptr;
size->setHeight(0);
size->setWidth(0);
@@ -199,7 +199,7 @@ QQuickTextureFactory *EtcProvider::requestTexture(const QString &id, QSize *size
ret = new QEtcTextureFactory;
ret->m_data = file.readAll();
if (!ret->m_data.isEmpty()) {
- ETCHeader *pETCHeader = NULL;
+ ETCHeader *pETCHeader = nullptr;
pETCHeader = (ETCHeader *)ret->m_data.data();
size->setHeight(getHeight(pETCHeader));
size->setWidth(getWidth(pETCHeader));
@@ -209,7 +209,7 @@ QQuickTextureFactory *EtcProvider::requestTexture(const QString &id, QSize *size
}
else {
delete ret;
- ret = 0;
+ ret = nullptr;
}
}