From 58c14c4a7edcecdd9d58b682a9360c83e2274ec5 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 18 Sep 2017 11:49:52 +0200 Subject: Replace Q_NULLPTR with nullptr where possible Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen Reviewed-by: Lars Knoll Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 4 +-- tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 2 +- .../corelib/io/qtextstream/tst_qtextstream.cpp | 2 +- .../corelib/kernel/qmetamethod/tst_qmetamethod.cpp | 2 +- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 8 ++--- tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp | 8 ++--- .../auto/corelib/kernel/qvariant/tst_qvariant.cpp | 2 +- .../thread/qwaitcondition/tst_qwaitcondition.cpp | 2 +- .../tools/qlatin1string/tst_qlatin1string.cpp | 8 ++--- .../corelib/tools/qringbuffer/tst_qringbuffer.cpp | 2 +- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 10 +++---- .../gui/kernel/qtouchevent/tst_qtouchevent.cpp | 4 +-- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 6 ++-- tests/auto/gui/qopengl/tst_qopengl.cpp | 2 +- tests/auto/gui/qvulkan/tst_qvulkan.cpp | 2 +- .../qhttpnetworkreply/tst_qhttpnetworkreply.cpp | 2 +- .../network/socket/qtcpsocket/tst_qtcpsocket.cpp | 2 +- tests/auto/tools/moc/tst_moc.cpp | 6 ++-- .../dialogs/qinputdialog/tst_qinputdialog.cpp | 2 +- .../dialogs/qmessagebox/tst_qmessagebox.cpp | 8 ++--- .../qgraphicsitem/tst_qgraphicsitem.cpp | 34 +++++++++++----------- .../qgraphicsscene/tst_qgraphicsscene.cpp | 2 +- .../qgraphicswidget/tst_qgraphicswidget.cpp | 6 ++-- .../widgets/itemviews/qlistview/tst_qlistview.cpp | 2 +- .../itemviews/qtreewidget/tst_qtreewidget.cpp | 2 +- tests/auto/widgets/kernel/qaction/tst_qaction.cpp | 4 +-- .../kernel/qapplication/tst_qapplication.cpp | 2 +- .../widgets/kernel/qboxlayout/tst_qboxlayout.cpp | 4 +-- .../widgets/kernel/qgridlayout/tst_qgridlayout.cpp | 6 ++-- .../widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp | 2 +- .../auto/widgets/kernel/qtooltip/tst_qtooltip.cpp | 4 +-- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 2 +- .../kernel/qwidget_window/tst_qwidget_window.cpp | 2 +- tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 4 +-- .../widgets/widgets/qcombobox/tst_qcombobox.cpp | 4 +-- .../widgets/widgets/qlineedit/tst_qlineedit.cpp | 4 +-- tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp | 2 +- .../auto/widgets/widgets/qmenubar/tst_qmenubar.cpp | 6 ++-- 38 files changed, 88 insertions(+), 88 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 881919fe4c..6b4d292fe3 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -708,7 +708,7 @@ void tst_QProcess::restartProcessDeadlock() QCOMPARE(process.write("", 1), qlonglong(1)); QVERIFY(process.waitForFinished(5000)); - QObject::disconnect(&process, static_cast(&QProcess::finished), Q_NULLPTR, Q_NULLPTR); + QObject::disconnect(&process, static_cast(&QProcess::finished), nullptr, nullptr); QCOMPARE(process.write("", 1), qlonglong(1)); QVERIFY(process.waitForFinished(5000)); @@ -847,7 +847,7 @@ void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives() QVERIFY(QTestEventLoop::instance().timeout()); QVERIFY(!proc.waitForReadyRead(250)); - QObject::disconnect(&proc, &QIODevice::readyRead, Q_NULLPTR, Q_NULLPTR); + QObject::disconnect(&proc, &QIODevice::readyRead, nullptr, nullptr); proc.write("B"); QVERIFY(proc.waitForReadyRead(5000)); diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 012ce5f2f5..db756ada39 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -207,7 +207,7 @@ void tst_QSettings::getSetCheck() QCOMPARE(true, obj1.fallbacksEnabled()); } -static QString settingsPath(const char *path = Q_NULLPTR) +static QString settingsPath(const char *path = nullptr) { // Temporary path for files that are specified explicitly in the constructor. #ifndef Q_OS_WINRT diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index 1aa15df590..df8746e518 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -634,7 +634,7 @@ void tst_QTextStream::readLineInto() ts.readLineInto(&line); QCOMPARE(line, QStringLiteral("1")); - ts.readLineInto(Q_NULLPTR, 0); // read the second line, but don't store it + ts.readLineInto(nullptr, 0); // read the second line, but don't store it ts.readLineInto(&line); QCOMPARE(line, QStringLiteral("3")); diff --git a/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp index 87196eaef1..4584b6ce31 100644 --- a/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp +++ b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp @@ -763,7 +763,7 @@ void tst_QMetaMethod::gadget() { // Call with null should not crash - MyGadget *gadget = Q_NULLPTR; + MyGadget *gadget = nullptr; QString string; QVERIFY(!setValueMethod.invokeOnGadget(gadget, Q_ARG(QString, QLatin1String("hi")))); QVERIFY(!getValueMethod.invokeOnGadget(gadget, Q_RETURN_ARG(QString, string))); diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 3a52c684d0..a3f3550307 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -6015,7 +6015,7 @@ public: struct SlotArgFunctor { - SlotArgFunctor(int *s) : status(s), context(Q_NULLPTR), sender(Q_NULLPTR) {} + SlotArgFunctor(int *s) : status(s), context(nullptr), sender(nullptr) {} SlotArgFunctor(ContextObject *context, QObject *sender, int *s) : status(s), context(context), sender(sender) {} void operator()() { *status = 2; if (context) context->compareSender(sender); } @@ -6453,7 +6453,7 @@ Q_SIGNALS: static int countedStructObjectsCount = 0; struct CountedStruct { - CountedStruct() : sender(Q_NULLPTR) { ++countedStructObjectsCount; } + CountedStruct() : sender(nullptr) { ++countedStructObjectsCount; } CountedStruct(GetSenderObject *sender) : sender(sender) { ++countedStructObjectsCount; } CountedStruct(const CountedStruct &o) : sender(o.sender) { ++countedStructObjectsCount; } CountedStruct &operator=(const CountedStruct &) { return *this; } @@ -6769,7 +6769,7 @@ class CountedExceptionThrower : public QObject Q_OBJECT public: - explicit CountedExceptionThrower(bool throwException, QObject *parent = Q_NULLPTR) + explicit CountedExceptionThrower(bool throwException, QObject *parent = nullptr) : QObject(parent) { if (throwException) @@ -6855,7 +6855,7 @@ void tst_QObject::exceptions() try { class ParentObject : public QObject { public: - explicit ParentObject(QObject *parent = Q_NULLPTR) + explicit ParentObject(QObject *parent = nullptr) : QObject(parent) { new CountedExceptionThrower(false, this); diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index e17d8ee38b..343a9384bc 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -754,7 +754,7 @@ void tst_QTimer::recurseOnTimeoutAndStopTimer() struct CountedStruct { - CountedStruct(int *count, QThread *t = Q_NULLPTR) : count(count), thread(t) { } + CountedStruct(int *count, QThread *t = nullptr) : count(count), thread(t) { } ~CountedStruct() { } void operator()() const { ++(*count); if (thread) QCOMPARE(QThread::currentThread(), thread); } @@ -763,7 +763,7 @@ struct CountedStruct }; static QScopedPointer _e; -static QThread *_t = Q_NULLPTR; +static QThread *_t = nullptr; class StaticEventLoop { @@ -827,7 +827,7 @@ void tst_QTimer::singleShotToFunctors() _t->quit(); _t->wait(); _t->deleteLater(); - _t = Q_NULLPTR; + _t = nullptr; { QObject c3; @@ -865,7 +865,7 @@ void tst_QTimer::singleShotToFunctors() QCOMPARE(count, 5); _e.reset(); - _t = Q_NULLPTR; + _t = nullptr; } void tst_QTimer::singleShot_chrono() diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index 0d45159d09..5d19cb8428 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -4927,7 +4927,7 @@ void tst_QVariant::accessSequentialContainerKey() { QMap mapping; QString name = QString::fromLatin1("Seven"); - mapping.insert(name, Q_NULLPTR); + mapping.insert(name, nullptr); QVariant variant = QVariant::fromValue(mapping); diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp index 4ef3bab87f..126cb6b180 100644 --- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp @@ -379,7 +379,7 @@ class WakeThreadBase : public TerminatingThread public: QAtomicInt *count; - WakeThreadBase() : count(Q_NULLPTR) {} + WakeThreadBase() : count(nullptr) {} }; class wake_Thread : public WakeThreadBase diff --git a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp index c8373b6ae9..dcfb0aa042 100644 --- a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp +++ b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp @@ -86,7 +86,7 @@ void tst_QLatin1String::nullString() // default ctor { QLatin1String l1; - QCOMPARE(static_cast(l1.data()), static_cast(Q_NULLPTR)); + QCOMPARE(static_cast(l1.data()), static_cast(nullptr)); QCOMPARE(l1.size(), 0); QString s = l1; @@ -95,9 +95,9 @@ void tst_QLatin1String::nullString() // from nullptr { - const char *null = Q_NULLPTR; + const char *null = nullptr; QLatin1String l1(null); - QCOMPARE(static_cast(l1.data()), static_cast(Q_NULLPTR)); + QCOMPARE(static_cast(l1.data()), static_cast(nullptr)); QCOMPARE(l1.size(), 0); QString s = l1; @@ -111,7 +111,7 @@ void tst_QLatin1String::nullString() QLatin1String l1(null); QEXPECT_FAIL("", "null QByteArrays become non-null QLatin1Strings...", Continue); - QCOMPARE(static_cast(l1.data()), static_cast(Q_NULLPTR)); + QCOMPARE(static_cast(l1.data()), static_cast(nullptr)); QCOMPARE(l1.size(), 0); QString s = l1; diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp index 145ba7ff72..deee7171b1 100644 --- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp +++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp @@ -68,7 +68,7 @@ void tst_QRingBuffer::constructing() QCOMPARE(ringBuffer.size(), Q_INT64_C(0)); QVERIFY(ringBuffer.isEmpty()); QCOMPARE(ringBuffer.nextDataBlockSize(), Q_INT64_C(0)); - QVERIFY(ringBuffer.readPointer() == Q_NULLPTR); + QVERIFY(ringBuffer.readPointer() == nullptr); QCOMPARE(ringBuffer.skip(5), Q_INT64_C(0)); QCOMPARE(ringBuffer.read(), QByteArray()); QCOMPARE(ringBuffer.getChar(), -1); diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index 70ccc72630..f6840e60a8 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -249,7 +249,7 @@ class CharStarContainer { const char *str; public: - explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = Q_NULLPTR) : str(s) {} + explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = nullptr) : str(s) {} Q_DECL_CONSTEXPR operator const char *() const { return str; } }; @@ -1483,7 +1483,7 @@ void tst_QString::indexOf() QRegularExpression re(QRegularExpression::escape(needle), options); QCOMPARE( haystack.indexOf(re, startpos), resultpos ); - QCOMPARE(haystack.indexOf(re, startpos, Q_NULLPTR), resultpos); + QCOMPARE(haystack.indexOf(re, startpos, nullptr), resultpos); QRegularExpressionMatch match; QVERIFY(!match.hasMatch()); @@ -1608,7 +1608,7 @@ void tst_QString::indexOfInvalidRegex() QTest::ignoreMessage(QtWarningMsg, "QString::indexOf: invalid QRegularExpression object"); QCOMPARE(QString("invalid regex\\").indexOf(QRegularExpression("invalid regex\\")), -1); QTest::ignoreMessage(QtWarningMsg, "QString::indexOf: invalid QRegularExpression object"); - QCOMPARE(QString("invalid regex\\").indexOf(QRegularExpression("invalid regex\\"), -1, Q_NULLPTR), -1); + QCOMPARE(QString("invalid regex\\").indexOf(QRegularExpression("invalid regex\\"), -1, nullptr), -1); QRegularExpressionMatch match; QVERIFY(!match.hasMatch()); @@ -1706,7 +1706,7 @@ void tst_QString::lastIndexOf() QRegularExpression re(QRegularExpression::escape(needle), options); QCOMPARE(haystack.lastIndexOf(re, from), expected); - QCOMPARE(haystack.lastIndexOf(re, from, Q_NULLPTR), expected); + QCOMPARE(haystack.lastIndexOf(re, from, nullptr), expected); QRegularExpressionMatch match; QVERIFY(!match.hasMatch()); QCOMPARE(haystack.lastIndexOf(re, from, &match), expected); @@ -1743,7 +1743,7 @@ void tst_QString::lastIndexOfInvalidRegex() QTest::ignoreMessage(QtWarningMsg, "QString::lastIndexOf: invalid QRegularExpression object"); QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), 0), -1); QTest::ignoreMessage(QtWarningMsg, "QString::lastIndexOf: invalid QRegularExpression object"); - QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), -1, Q_NULLPTR), -1); + QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), -1, nullptr), -1); QRegularExpressionMatch match; QVERIFY(!match.hasMatch()); diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp index d56b09b75d..706c66ef14 100644 --- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp +++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp @@ -48,7 +48,7 @@ public: ulong timestamp; QTouchDevice *deviceFromEvent; - explicit tst_QTouchEventWidget(QWidget *parent = Q_NULLPTR) : QWidget(parent) + explicit tst_QTouchEventWidget(QWidget *parent = nullptr) : QWidget(parent) { reset(); } @@ -117,7 +117,7 @@ public: bool deleteInTouchBegin, deleteInTouchUpdate, deleteInTouchEnd; tst_QTouchEventGraphicsItem **weakpointer; - explicit tst_QTouchEventGraphicsItem(QGraphicsItem *parent = Q_NULLPTR) + explicit tst_QTouchEventGraphicsItem(QGraphicsItem *parent = nullptr) : QGraphicsItem(parent), weakpointer(0) { reset(); diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 40f825fa4a..24f61e4584 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -698,7 +698,7 @@ class PlatformWindowFilter : public QObject public: PlatformWindowFilter(QObject *parent = 0) : QObject(parent) - , m_window(Q_NULLPTR) + , m_window(nullptr) , m_alwaysExisted(true) {} @@ -710,7 +710,7 @@ public: // If they are, the native platform surface should always exist when we // receive a QPlatformSurfaceEvent if (e->type() == QEvent::PlatformSurface && o == m_window) { - m_alwaysExisted &= (m_window->handle() != Q_NULLPTR); + m_alwaysExisted &= (m_window->handle() != nullptr); } return false; } @@ -737,7 +737,7 @@ void tst_QWindow::platformSurface() QTRY_COMPARE(window.received(QEvent::PlatformSurface), 1); QTRY_COMPARE(window.surfaceEventType(), QPlatformSurfaceEvent::SurfaceCreated); - QTRY_VERIFY(window.handle() != Q_NULLPTR); + QTRY_VERIFY(window.handle() != nullptr); window.destroy(); QTRY_COMPARE(window.received(QEvent::PlatformSurface), 2); diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp index 6d9456fa69..f23eb70a36 100644 --- a/tests/auto/gui/qopengl/tst_qopengl.cpp +++ b/tests/auto/gui/qopengl/tst_qopengl.cpp @@ -1593,7 +1593,7 @@ void tst_QOpenGL::defaultQGLCurrentBuffer() ctx->makeCurrent(surface.data()); // Bind default FBO on the current context, and record what's the current QGL FBO. It should - // be Q_NULLPTR because the default platform OpenGL FBO is not backed by a + // be nullptr because the default platform OpenGL FBO is not backed by a // QOpenGLFramebufferObject. QOpenGLFramebufferObject::bindDefault(); QOpenGLFramebufferObject *defaultQFBO = QOpenGLContextPrivate::get(ctx.data())->qgl_current_fbo; diff --git a/tests/auto/gui/qvulkan/tst_qvulkan.cpp b/tests/auto/gui/qvulkan/tst_qvulkan.cpp index 8027935003..716d49a2f1 100644 --- a/tests/auto/gui/qvulkan/tst_qvulkan.cpp +++ b/tests/auto/gui/qvulkan/tst_qvulkan.cpp @@ -166,7 +166,7 @@ static void waitForUnexposed(QWindow *w) if (remaining <= 0) break; QCoreApplication::processEvents(QEventLoop::AllEvents, remaining); - QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete); + QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); QTest::qSleep(10); } } diff --git a/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp b/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp index ec965a61b2..edfef09a96 100644 --- a/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp +++ b/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp @@ -104,7 +104,7 @@ void tst_QHttpNetworkReply::parseHeader() class TestHeaderSocket : public QAbstractSocket { public: - explicit TestHeaderSocket(const QByteArray &input) : QAbstractSocket(QAbstractSocket::TcpSocket, Q_NULLPTR) + explicit TestHeaderSocket(const QByteArray &input) : QAbstractSocket(QAbstractSocket::TcpSocket, nullptr) { inputBuffer.setData(input); inputBuffer.open(QIODevice::ReadOnly | QIODevice::Unbuffered); diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index 7340817ade..493263f2b8 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -3126,7 +3126,7 @@ void tst_QTcpSocket::readNotificationsAfterBind() if (setProxy) return; - QAbstractSocket socket(QAbstractSocket::TcpSocket, Q_NULLPTR); + QAbstractSocket socket(QAbstractSocket::TcpSocket, nullptr); QVERIFY2(socket.bind(), "Bind error!"); connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 55e8054a70..542626adab 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -163,7 +163,7 @@ class CreatableGadget public: Q_INVOKABLE CreatableGadget() { - CreatableGadget::qt_static_metacall((QObject*)this, QMetaObject::ReadProperty, -1, Q_NULLPTR); + CreatableGadget::qt_static_metacall((QObject*)this, QMetaObject::ReadProperty, -1, nullptr); } }; @@ -223,7 +223,7 @@ namespace { { Q_OBJECT public: - explicit ObjectInUnnamedNS(QObject *parent = Q_NULLPTR) : QObject(parent) {} + explicit ObjectInUnnamedNS(QObject *parent = nullptr) : QObject(parent) {} }; } @@ -3768,7 +3768,7 @@ void tst_Moc::veryLongStringData() void tst_Moc::gadgetHierarchy() { - QCOMPARE(NonGadgetParent::Derived::staticMetaObject.superClass(), static_cast(Q_NULLPTR)); + QCOMPARE(NonGadgetParent::Derived::staticMetaObject.superClass(), static_cast(nullptr)); QCOMPARE(GrandParentGadget::DerivedGadget::staticMetaObject.superClass(), &GrandParentGadget::BaseGadget::staticMetaObject); } diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp index 62286d703f..259de49c67 100644 --- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp @@ -338,7 +338,7 @@ class SelfDestructParent : public QWidget Q_OBJECT public: explicit SelfDestructParent(int delay = 100) - : QWidget(Q_NULLPTR) + : QWidget(nullptr) { QTimer::singleShot(delay, this, SLOT(deleteLater())); } diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index 7a7cfb5704..50f87b2c70 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -134,10 +134,10 @@ class ExecCloseHelper : public QObject public: enum { CloseWindow = -1 }; - explicit ExecCloseHelper(QObject *parent = Q_NULLPTR) - : QObject(parent), m_key(0), m_timerId(0), m_testCandidate(Q_NULLPTR) { } + explicit ExecCloseHelper(QObject *parent = nullptr) + : QObject(parent), m_key(0), m_timerId(0), m_testCandidate(nullptr) { } - void start(int key, QWidget *testCandidate = Q_NULLPTR) + void start(int key, QWidget *testCandidate = nullptr) { m_key = key; m_testCandidate = testCandidate; @@ -172,7 +172,7 @@ void ExecCloseHelper::timerEvent(QTimerEvent *te) QKeyEvent *ke = new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier); QCoreApplication::postEvent(m_testCandidate, ke); } - m_testCandidate = Q_NULLPTR; + m_testCandidate = nullptr; killTimer(m_timerId); m_timerId = m_key = 0; } diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 96827022a8..63fe2e6cb4 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -1110,11 +1110,11 @@ void tst_QGraphicsItem::visible() scene.addItem(item); QVERIFY(item->isVisible()); - QCOMPARE(scene.items(QPointF(0, 0)).value(0, Q_NULLPTR), item); + QCOMPARE(scene.items(QPointF(0, 0)).value(0, nullptr), item); item->setVisible(false); QVERIFY(scene.items(QPointF(0, 0)).isEmpty()); item->setVisible(true); - QCOMPARE(scene.items(QPointF(0, 0)).value(0, Q_NULLPTR), item); + QCOMPARE(scene.items(QPointF(0, 0)).value(0, nullptr), item); QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress); event.setButton(Qt::LeftButton); @@ -5503,16 +5503,16 @@ void tst_QGraphicsItem::itemClipsChildrenToShape2() QGraphicsScene scene; scene.addItem(parent); - QCOMPARE(scene.items(QPointF(5, 5)).value(0, Q_NULLPTR), (QGraphicsItem *)parent); + QCOMPARE(scene.items(QPointF(5, 5)).value(0, nullptr), (QGraphicsItem *)parent); QVERIFY(scene.items(QPointF(15, 5)).isEmpty()); QVERIFY(scene.items(QPointF(5, 15)).isEmpty()); QVERIFY(scene.items(QPointF(60, 60)).isEmpty()); QVERIFY(scene.items(QPointF(140, 60)).isEmpty()); QVERIFY(scene.items(QPointF(60, 140)).isEmpty()); QVERIFY(scene.items(QPointF(140, 140)).isEmpty()); - QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child2); - QCOMPARE(scene.items(QPointF(75, 100)).value(0, Q_NULLPTR), (QGraphicsItem *)child1); - QCOMPARE(scene.items(QPointF(100, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child1); + QCOMPARE(scene.items(QPointF(75, 75)).value(0, nullptr), (QGraphicsItem *)child2); + QCOMPARE(scene.items(QPointF(75, 100)).value(0, nullptr), (QGraphicsItem *)child1); + QCOMPARE(scene.items(QPointF(100, 75)).value(0, nullptr), (QGraphicsItem *)child1); QImage image(100, 100, QImage::Format_ARGB32_Premultiplied); image.fill(0); @@ -5547,9 +5547,9 @@ void tst_QGraphicsItem::itemClipsChildrenToShape3() grandchild->setPos( 50, 50 ); parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape); - QCOMPARE(scene.items(QPointF(25, 25)).value(0, Q_NULLPTR), (QGraphicsItem *)parent); - QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child); - QCOMPARE(scene.items(QPointF(125, 125)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild); + QCOMPARE(scene.items(QPointF(25, 25)).value(0, nullptr), (QGraphicsItem *)parent); + QCOMPARE(scene.items(QPointF(75, 75)).value(0, nullptr), (QGraphicsItem *)child); + QCOMPARE(scene.items(QPointF(125, 125)).value(0, nullptr), (QGraphicsItem *)grandchild); QVERIFY(scene.items(QPointF(175, 175)).isEmpty()); // Move child to fully overlap the parent. The grandchild should @@ -5557,9 +5557,9 @@ void tst_QGraphicsItem::itemClipsChildrenToShape3() child->prepareGeometryChange(); child->setPos( 0, 0 ); - QCOMPARE(scene.items(QPointF(25, 25)).value(0, Q_NULLPTR), (QGraphicsItem *)child); - QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild); - QCOMPARE(scene.items(QPointF(125, 125)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild); + QCOMPARE(scene.items(QPointF(25, 25)).value(0, nullptr), (QGraphicsItem *)child); + QCOMPARE(scene.items(QPointF(75, 75)).value(0, nullptr), (QGraphicsItem *)grandchild); + QCOMPARE(scene.items(QPointF(125, 125)).value(0, nullptr), (QGraphicsItem *)grandchild); QVERIFY(scene.items(QPointF(175, 175)).isEmpty()); } @@ -5832,8 +5832,8 @@ void tst_QGraphicsItem::itemClippingDiscovery() rightRectItem->setParentItem(clipItem); // The rects item are both visible at these points. - QCOMPARE(scene.items(QPointF(10, 10)).value(0, Q_NULLPTR), (QGraphicsItem *)leftRectItem); - QCOMPARE(scene.items(QPointF(90, 90)).value(0, Q_NULLPTR), (QGraphicsItem *)rightRectItem); + QCOMPARE(scene.items(QPointF(10, 10)).value(0, nullptr), (QGraphicsItem *)leftRectItem); + QCOMPARE(scene.items(QPointF(90, 90)).value(0, nullptr), (QGraphicsItem *)rightRectItem); // The ellipse clips the rects now. clipItem->setFlag(QGraphicsItem::ItemClipsChildrenToShape); @@ -5873,7 +5873,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape() int oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls; // First test that both items are searched if no optimization flags are set - QGraphicsItem* item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR); + QGraphicsItem* item = scene.items(QPointF(25, 5)).value(0, nullptr); QCOMPARE(item, childOutsideShape); QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); @@ -5884,7 +5884,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape() oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls; // Repeat the test to make sure that no caching/indexing is in effect - item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR); + item = scene.items(QPointF(25, 5)).value(0, nullptr); QCOMPARE(item, childOutsideShape); QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); @@ -5897,7 +5897,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape() // Set the optimization flag and make sure that the child is not returned // and that the child's boundingRect() method is never called. parent->setFlag(QGraphicsItem::ItemContainsChildrenInShape); - item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR); + item = scene.items(QPointF(25, 5)).value(0, nullptr); QVERIFY(!(item)); QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls); diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index 7615c5e821..6e4da153d2 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -295,7 +295,7 @@ void tst_QGraphicsScene::construction() static inline const QGraphicsItem *itemAt(const QGraphicsScene &scene, qreal x, qreal y) { - return scene.items(QPointF(x, y)).value(0, Q_NULLPTR); + return scene.items(QPointF(x, y)).value(0, nullptr); } void tst_QGraphicsScene::sceneRect() diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index a3c6805c7e..85b42e54fe 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -2059,10 +2059,10 @@ void tst_QGraphicsWidget::task236127_bspTreeIndexFails() QTRY_VERIFY(scene.items(QPointF(25, 25)).isEmpty()); widget->setGeometry(0, 112, 360, 528); - QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, Q_NULLPTR), (QGraphicsItem *)widget); + QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, nullptr), (QGraphicsItem *)widget); widget2->setGeometry(0, 573, 360, 67); - QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, Q_NULLPTR), (QGraphicsItem *)widget); - QTRY_COMPARE(scene.items(QPointF(50, 585)).value(0, Q_NULLPTR), (QGraphicsItem *)widget2); + QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, nullptr), (QGraphicsItem *)widget); + QTRY_COMPARE(scene.items(QPointF(50, 585)).value(0, nullptr), (QGraphicsItem *)widget2); } void tst_QGraphicsWidget::defaultSize() diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index b9785c35ac..11bd118e4b 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -288,7 +288,7 @@ public: class ScrollPerItemListView : public QListView { public: - explicit ScrollPerItemListView(QWidget *parent = Q_NULLPTR) + explicit ScrollPerItemListView(QWidget *parent = nullptr) : QListView(parent) { // Force per item scroll mode since it comes from the style by default diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp index fa7f9596da..3317c79daa 100644 --- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp @@ -3449,7 +3449,7 @@ void tst_QTreeWidget::getMimeDataWithInvalidItem() { CustomTreeWidget w; QTest::ignoreMessage(QtWarningMsg, "QTreeWidget::mimeData: Null-item passed"); - QMimeData *md = w.mimeData(QList() << Q_NULLPTR); + QMimeData *md = w.mimeData(QList() << nullptr); QVERIFY(!md); } diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp index ac6362168e..2eb8c17359 100644 --- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp +++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp @@ -350,7 +350,7 @@ void tst_QAction::enabledVisibleInteraction() void tst_QAction::task200823_tooltip() { - const QScopedPointer action(new QAction("foo", Q_NULLPTR)); + const QScopedPointer action(new QAction("foo", nullptr)); QString shortcut("ctrl+o"); action->setShortcut(shortcut); @@ -364,7 +364,7 @@ void tst_QAction::task200823_tooltip() void tst_QAction::task229128TriggeredSignalWithoutActiongroup() { // test without a group - const QScopedPointer actionWithoutGroup(new QAction("Test", Q_NULLPTR)); + const QScopedPointer actionWithoutGroup(new QAction("Test", nullptr)); QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), SIGNAL(triggered(bool))); QCOMPARE(spyWithoutGroup.count(), 0); actionWithoutGroup->trigger(); diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 6ff38abdb8..c70ac0309f 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -2214,7 +2214,7 @@ void tst_QApplication::staticFunctions() QApplication::activeModalWidget(); QApplication::focusWidget(); QApplication::activeWindow(); - QApplication::setActiveWindow(Q_NULLPTR); + QApplication::setActiveWindow(nullptr); QApplication::widgetAt(QPoint(0, 0)); QApplication::topLevelAt(QPoint(0, 0)); QApplication::setGlobalStrut(QSize(0, 0)); diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp index 0b35db1b5f..c39c770316 100644 --- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp +++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp @@ -297,7 +297,7 @@ void tst_QBoxLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){ layout.setObjectName("ef9e2b42298e0e6420105bb"); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QVBoxLayout/ef9e2b42298e0e6420105bb"); - layout.addWidget(Q_NULLPTR); + layout.addWidget(nullptr); QCOMPARE(layout.count(), 0); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/347b469225a24a0ef05150a to its child layout QVBoxLayout/ef9e2b42298e0e6420105bb"); @@ -313,7 +313,7 @@ void tst_QBoxLayout::taskQTBUG_40609_addingLayoutToItself(){ layout.setObjectName("cc751dd0f50f62b05a62da"); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QVBoxLayout/cc751dd0f50f62b05a62da"); - layout.addLayout(Q_NULLPTR); + layout.addLayout(nullptr); QCOMPARE(layout.count(), 0); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QVBoxLayout/cc751dd0f50f62b05a62da to itself"); diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp index c1ab5f51be..50de83c8f7 100644 --- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp +++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp @@ -342,7 +342,7 @@ void tst_QGridLayout::setMinAndMaxSize() layout.removeItem(spacer); delete spacer; - spacer = Q_NULLPTR; + spacer = nullptr; rightChild.hide(); QApplication::sendPostedEvents(0, 0); @@ -1630,7 +1630,7 @@ void tst_QGridLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){ layout.setObjectName("d631e91a35f2b66a6dff35"); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QGridLayout/d631e91a35f2b66a6dff35"); - layout.addWidget(Q_NULLPTR, 0, 0); + layout.addWidget(nullptr, 0, 0); QCOMPARE(layout.count(), 0); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/9bb37ca762aeb7269b8 to its child layout QGridLayout/d631e91a35f2b66a6dff35"); @@ -1645,7 +1645,7 @@ void tst_QGridLayout::taskQTBUG_40609_addingLayoutToItself(){ layout.setObjectName("5d79e1b0aed83f100e3c2"); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QGridLayout/5d79e1b0aed83f100e3c2"); - layout.addLayout(Q_NULLPTR, 0, 0); + layout.addLayout(nullptr, 0, 0); QCOMPARE(layout.count(), 0); QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QGridLayout/5d79e1b0aed83f100e3c2 to itself"); diff --git a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp index d50f46cc16..eb3264be53 100644 --- a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp +++ b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp @@ -60,7 +60,7 @@ private: struct PrettyPrint { const char *m_s; template - explicit PrettyPrint(const T &t) : m_s(Q_NULLPTR) + explicit PrettyPrint(const T &t) : m_s(nullptr) { using QT_PREPEND_NAMESPACE(QTest)::toString; m_s = toString(t); diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp index c163117ef3..86736bb082 100644 --- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp +++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp @@ -129,7 +129,7 @@ static QWidget *findWhatsThat() if (widget->inherits("QWhatsThat")) return widget; } - return Q_NULLPTR; + return nullptr; } void tst_QToolTip::whatsThis() @@ -137,7 +137,7 @@ void tst_QToolTip::whatsThis() qApp->setStyleSheet( "QWidget { font-size: 72px; }" ); QWhatsThis::showText(QPoint(0, 0), "This is text"); - QWidget *whatsthis = Q_NULLPTR; + QWidget *whatsthis = nullptr; QTRY_VERIFY( (whatsthis = findWhatsThat()) ); QVERIFY(whatsthis->isVisible()); const int whatsThisHeight = whatsthis->height(); diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 0ec8c6d9b1..6fcf6dc3ed 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -10334,7 +10334,7 @@ public slots: QTimer::singleShot(100, this, SLOT(doMouseMoves())); modal->exec(); delete modal; - modal = Q_NULLPTR; + modal = nullptr; } void doMouseMoves() diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp index 6dabc06b6d..a158b6cbc9 100644 --- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp +++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp @@ -218,7 +218,7 @@ class PaintTestWidget : public QWidget public: int paintEventCount; - explicit PaintTestWidget(QWidget *parent = Q_NULLPTR) + explicit PaintTestWidget(QWidget *parent = nullptr) : QWidget(parent) , paintEventCount(0) {} diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index f9c6b4c966..30177dfa86 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -779,7 +779,7 @@ class TestStyleOptionInitProxy: public QProxyStyle Q_OBJECT public: mutable bool invalidOptionsDetected; - explicit TestStyleOptionInitProxy(QStyle *style = Q_NULLPTR) + explicit TestStyleOptionInitProxy(QStyle *style = nullptr) : QProxyStyle(style), invalidOptionsDetected(false) {} @@ -846,7 +846,7 @@ public: private: void checkStyle(const QByteArray &info, const QStyleOption *opt) const { - if (opt && (opt->version == 0 || opt->styleObject == Q_NULLPTR) ) { + if (opt && (opt->version == 0 || opt->styleObject == nullptr) ) { invalidOptionsDetected = true; qWarning() << baseStyle()->metaObject()->className() << "Invalid QStyleOption found for" diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 2f4e1a32f3..3415d06bc6 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -3277,7 +3277,7 @@ void tst_QComboBox::task_QTBUG_49831_scrollerNotActivated() class QTBUG_56693_Model : public QStandardItemModel { public: - QTBUG_56693_Model(QObject *parent = Q_NULLPTR) + QTBUG_56693_Model(QObject *parent = nullptr) : QStandardItemModel(parent) { } @@ -3305,7 +3305,7 @@ public: } - void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = Q_NULLPTR) const override + void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const override { if (element == CE_MenuItem) if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast(opt)) diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 105ace8d97..b865a10874 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -3068,7 +3068,7 @@ void tst_QLineEdit::cutWithoutSelection() QClipboard *clipboard = QGuiApplication::clipboard(); if (!PlatformClipboard::isAvailable() || !QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive)) { // Avoid unstable X11 clipboard - clipboard = Q_NULLPTR; + clipboard = nullptr; } if (clipboard) @@ -4497,7 +4497,7 @@ template T *findAssociatedWidget(const QAction *a) if (T *result = qobject_cast(w)) return result; } - return Q_NULLPTR; + return nullptr; } void tst_QLineEdit::sideWidgetsActionEvents() diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index b0ec4a55f4..4408533c85 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -617,7 +617,7 @@ static QMenu *getTornOffMenu() if (w->isVisible() && w->inherits("QTornOffMenu")) return static_cast(w); } - return Q_NULLPTR; + return nullptr; } void tst_QMenu::tearOff() diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp index 9a0ca0565e..789ea57dfc 100644 --- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp @@ -1494,7 +1494,7 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested() //set the new parent, a window QScopedPointer windowedParent; - windowedParent.reset(new QWidget(Q_NULLPTR, Qt::WindowFlags())); + windowedParent.reset(new QWidget(nullptr, Qt::WindowFlags())); windowedParent->setGeometry(400, 10, 300, 300); windowedParent->show(); @@ -1511,7 +1511,7 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested() //to windowedParent<-movingParent<-containerWidget<-containedWidget<-menuBar movingParent.setParent(windowedParent.data(),0); // this resets the parenting and the menu bar's window - taskQTBUG53205MenuBar->setParent(Q_NULLPTR); + taskQTBUG53205MenuBar->setParent(nullptr); taskQTBUG53205MenuBar->setParent(&containedWidget); //from windowedParent<-movingParent<-containerWidget<-containedWidget<-menuBar //to : QMainWindow<-hiddenParent<-movingParent<-containerWidget<-containedWidget<-menuBar @@ -1543,7 +1543,7 @@ void tst_QMenuBar::platformMenu() void tst_QMenuBar::slotForTaskQTBUG53205() { QWidget *parent = taskQTBUG53205MenuBar->parentWidget(); - taskQTBUG53205MenuBar->setParent(Q_NULLPTR); + taskQTBUG53205MenuBar->setParent(nullptr); taskQTBUG53205MenuBar->setParent(parent); } -- cgit v1.2.3