From ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 22 Nov 2019 14:46:58 +0100 Subject: Tidy nullptr usage Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/gui/kernel/qcursor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/gui/kernel/qcursor.cpp') diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index 1ba8760a9d..4ae5412367 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -384,7 +384,7 @@ QDataStream &operator>>(QDataStream &s, QCursor &c) */ QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY) - : d(0) + : d(nullptr) { QImage img = pixmap.toImage().convertToFormat(QImage::Format_Indexed8, Qt::ThresholdDither|Qt::AvoidDither); QBitmap bm = QBitmap::fromImage(img, Qt::ThresholdDither|Qt::AvoidDither); @@ -440,7 +440,7 @@ QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY) */ QCursor::QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY) - : d(0) + : d(nullptr) { d = QCursorData::setBitmap(bitmap, mask, hotX, hotY, 1.0); } @@ -452,7 +452,7 @@ QCursor::QCursor() { if (!QCursorData::initialized) { if (QCoreApplication::startingUp()) { - d = 0; + d = nullptr; return; } QCursorData::initialize(); @@ -470,7 +470,7 @@ QCursor::QCursor() \sa setShape() */ QCursor::QCursor(Qt::CursorShape shape) - : d(0) + : d(nullptr) { if (!QCursorData::initialized) QCursorData::initialize(); @@ -550,7 +550,7 @@ void QCursor::setShape(Qt::CursorShape shape) { if (!QCursorData::initialized) QCursorData::initialize(); - QCursorData *c = uint(shape) <= Qt::LastCursor ? qt_cursorTable[shape] : 0; + QCursorData *c = uint(shape) <= Qt::LastCursor ? qt_cursorTable[shape] : nullptr; if (!c) c = qt_cursorTable[0]; c->ref.ref(); @@ -675,7 +675,7 @@ QCursorData *qt_cursorTable[Qt::LastCursor + 1]; bool QCursorData::initialized = false; QCursorData::QCursorData(Qt::CursorShape s) - : ref(1), cshape(s), bm(0), bmm(0), hx(0), hy(0) + : ref(1), cshape(s), bm(nullptr), bmm(nullptr), hx(0), hy(0) { } @@ -695,7 +695,7 @@ void QCursorData::cleanup() // In case someone has a static QCursor defined with this shape if (!qt_cursorTable[shape]->ref.deref()) delete qt_cursorTable[shape]; - qt_cursorTable[shape] = 0; + qt_cursorTable[shape] = nullptr; } QCursorData::initialized = false; } -- cgit v1.2.3