summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp4
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp2
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp2
-rw-r--r--tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp2
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp8
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp8
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp2
-rw-r--r--tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp2
-rw-r--r--tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp8
-rw-r--r--tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp2
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp10
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp4
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp6
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp2
-rw-r--r--tests/auto/gui/qvulkan/tst_qvulkan.cpp2
-rw-r--r--tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp2
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp2
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp6
-rw-r--r--tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp8
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp34
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp6
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp2
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp4
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp2
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp4
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp6
-rw-r--r--tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp2
-rw-r--r--tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp4
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp2
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp4
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp4
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp4
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp2
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp6
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp2
-rw-r--r--tests/manual/cocoa/menurama/menuramaapplication.cpp2
-rw-r--r--tests/manual/diaglib/logwidget.cpp2
-rw-r--r--tests/manual/foreignwindows/main.cpp6
-rw-r--r--tests/manual/qlayout/gridwidget.cpp4
-rw-r--r--tests/manual/qlayout/hbwidget.cpp4
-rw-r--r--tests/manual/qlayout/vbwidget.cpp4
-rw-r--r--tests/manual/qscreen/main.cpp2
-rw-r--r--tests/manual/qscreen/propertywatcher.cpp2
-rw-r--r--tests/manual/qscreen/propertywatcher.h2
-rw-r--r--tests/manual/touch/main.cpp2
-rw-r--r--tests/manual/widgets/styles/main.cpp6
50 files changed, 107 insertions, 107 deletions
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<QProcessFinishedSignal1>(&QProcess::finished), Q_NULLPTR, Q_NULLPTR);
+ QObject::disconnect(&process, static_cast<QProcessFinishedSignal1>(&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<QEventLoop> _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<QString, QObject*> 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<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(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<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(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<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(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<const QMetaObject*>(Q_NULLPTR));
+ QCOMPARE(NonGadgetParent::Derived::staticMetaObject.superClass(), static_cast<const QMetaObject*>(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<QTreeWidgetItem*>() << Q_NULLPTR);
+ QMimeData *md = w.mimeData(QList<QTreeWidgetItem*>() << 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<QAction> action(new QAction("foo", Q_NULLPTR));
+ const QScopedPointer<QAction> 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<QAction> actionWithoutGroup(new QAction("Test", Q_NULLPTR));
+ const QScopedPointer<QAction> 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 <typename T>
- 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<const QStyleOptionMenuItem *>(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 <class T> T *findAssociatedWidget(const QAction *a)
if (T *result = qobject_cast<T *>(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<QMenu *>(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<QWidget> 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);
}
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index 622df2fb3b..6145fabbf8 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -216,7 +216,7 @@ void tst_QGraphicsScene::itemAt()
QGraphicsItem *item = 0;
QBENCHMARK {
- item = scene.items(QPointF(0, 0)).value(0, Q_NULLPTR);
+ item = scene.items(QPointF(0, 0)).value(0, nullptr);
}
//let QGraphicsScene::_q_polishItems be called so ~QGraphicsItem doesn't spend all his time cleaning the unpolished list
diff --git a/tests/manual/cocoa/menurama/menuramaapplication.cpp b/tests/manual/cocoa/menurama/menuramaapplication.cpp
index acd44565eb..5fb2041ae4 100644
--- a/tests/manual/cocoa/menurama/menuramaapplication.cpp
+++ b/tests/manual/cocoa/menurama/menuramaapplication.cpp
@@ -71,5 +71,5 @@ QAction *MenuramaApplication::findAction(QLatin1String title, QMenu *parentMenu)
if (a->text() == title)
return a;
- return Q_NULLPTR;
+ return nullptr;
}
diff --git a/tests/manual/diaglib/logwidget.cpp b/tests/manual/diaglib/logwidget.cpp
index 8e4844fab2..35fabd6e2e 100644
--- a/tests/manual/diaglib/logwidget.cpp
+++ b/tests/manual/diaglib/logwidget.cpp
@@ -133,7 +133,7 @@ void LogWidget::install()
qInfo("%s", qPrintable(LogWidget::startupMessage()));
}
-void LogWidget::uninstall() { qInstallMessageHandler(Q_NULLPTR); }
+void LogWidget::uninstall() { qInstallMessageHandler(nullptr); }
#else // Qt 5
diff --git a/tests/manual/foreignwindows/main.cpp b/tests/manual/foreignwindows/main.cpp
index cda7e7207e..74c6d8c376 100644
--- a/tests/manual/foreignwindows/main.cpp
+++ b/tests/manual/foreignwindows/main.cpp
@@ -110,7 +110,7 @@ EmbeddingWindow::EmbeddingWindow(QWindow *window) : m_window(window)
+ QLatin1String(" 0x") + QString::number(window->winId(), 16);
setWindowTitle(title);
setObjectName("MainWindow");
- QWidget *container = QWidget::createWindowContainer(window, Q_NULLPTR, Qt::Widget);
+ QWidget *container = QWidget::createWindowContainer(window, nullptr, Qt::Widget);
container->setObjectName("Container");
setCentralWidget(container);
@@ -149,8 +149,8 @@ EmbeddingWindow::EmbeddingWindow(QWindow *window) : m_window(window)
void EmbeddingWindow::releaseForeignWindow()
{
if (m_window) {
- m_window->setParent(Q_NULLPTR);
- m_window = Q_NULLPTR;
+ m_window->setParent(nullptr);
+ m_window = nullptr;
m_releaseAction->setEnabled(false);
}
}
diff --git a/tests/manual/qlayout/gridwidget.cpp b/tests/manual/qlayout/gridwidget.cpp
index ede13a22c3..f19b3eac6f 100644
--- a/tests/manual/qlayout/gridwidget.cpp
+++ b/tests/manual/qlayout/gridwidget.cpp
@@ -62,8 +62,8 @@ GridWidget::GridWidget(QWidget *parent) :
qDebug("There should be four warnings, but no crash or freeze:");
hb->addWidget(this, 6, 6); ///< This command should print a warning, but should not add "this"
- hb->addWidget(Q_NULLPTR, 6, 7); ///< This command should print a warning, but should not add "NULL"
+ hb->addWidget(nullptr, 6, 7); ///< This command should print a warning, but should not add "NULL"
hb->addLayout(hb, 7, 6); ///< This command should print a warning, but should not add "hb"
- hb->addLayout(Q_NULLPTR, 7, 7); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(nullptr, 7, 7); ///< This command should print a warning, but should not add "NULL"
qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/hbwidget.cpp b/tests/manual/qlayout/hbwidget.cpp
index d1f6c94d5b..80219d01fd 100644
--- a/tests/manual/qlayout/hbwidget.cpp
+++ b/tests/manual/qlayout/hbwidget.cpp
@@ -58,8 +58,8 @@ HbWidget::HbWidget(QWidget *parent) :
qDebug("There should be four warnings, but no crash or freeze:");
hb->addWidget(this); ///< This command should print a warning, but should not add "this"
- hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addWidget(nullptr); ///< This command should print a warning, but should not add "NULL"
hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
- hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(nullptr); ///< This command should print a warning, but should not add "NULL"
qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/vbwidget.cpp b/tests/manual/qlayout/vbwidget.cpp
index d3898422fb..97f240f9a0 100644
--- a/tests/manual/qlayout/vbwidget.cpp
+++ b/tests/manual/qlayout/vbwidget.cpp
@@ -58,8 +58,8 @@ VbWidget::VbWidget(QWidget *parent) :
qDebug("There should be four warnings, but no crash or freeze:");
hb->addWidget(this); ///< This command should print a warning, but should not add "this"
- hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addWidget(nullptr); ///< This command should print a warning, but should not add "NULL"
hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
- hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(nullptr); ///< This command should print a warning, but should not add "NULL"
qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qscreen/main.cpp b/tests/manual/qscreen/main.cpp
index 4b9f49e9f0..6fba872b12 100644
--- a/tests/manual/qscreen/main.cpp
+++ b/tests/manual/qscreen/main.cpp
@@ -100,7 +100,7 @@ class ScreenPropertyWatcher : public PropertyWatcher
{
Q_OBJECT
public:
- ScreenPropertyWatcher(QWidget *wp = Q_NULLPTR) : PropertyWatcher(Q_NULLPTR, QString(), wp)
+ ScreenPropertyWatcher(QWidget *wp = nullptr) : PropertyWatcher(nullptr, QString(), wp)
{
// workaround for the fact that virtualSiblings is not a property,
// thus there is no change notification:
diff --git a/tests/manual/qscreen/propertywatcher.cpp b/tests/manual/qscreen/propertywatcher.cpp
index 0fb322a480..d2a552f108 100644
--- a/tests/manual/qscreen/propertywatcher.cpp
+++ b/tests/manual/qscreen/propertywatcher.cpp
@@ -34,7 +34,7 @@
#include "propertyfield.h"
PropertyWatcher::PropertyWatcher(QObject *subject, QString annotation, QWidget *parent)
- : QWidget(parent), m_subject(Q_NULLPTR), m_formLayout(new QFormLayout(this))
+ : QWidget(parent), m_subject(nullptr), m_formLayout(new QFormLayout(this))
{
setMinimumSize(450, 300);
m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
diff --git a/tests/manual/qscreen/propertywatcher.h b/tests/manual/qscreen/propertywatcher.h
index f371a3b9b6..d988d96c91 100644
--- a/tests/manual/qscreen/propertywatcher.h
+++ b/tests/manual/qscreen/propertywatcher.h
@@ -39,7 +39,7 @@ class PropertyWatcher : public QWidget
Q_OBJECT
public:
- explicit PropertyWatcher(QObject* subject = Q_NULLPTR, QString annotation = QString(), QWidget *parent = Q_NULLPTR);
+ explicit PropertyWatcher(QObject* subject = nullptr, QString annotation = QString(), QWidget *parent = nullptr);
QFormLayout *formLayout() { return m_formLayout; }
diff --git a/tests/manual/touch/main.cpp b/tests/manual/touch/main.cpp
index 9d4b8d08bd..d3c6079c7d 100644
--- a/tests/manual/touch/main.cpp
+++ b/tests/manual/touch/main.cpp
@@ -169,7 +169,7 @@ void SwipeGesture::draw(const QRectF &rect, QPainter &painter) const
Gesture *Gesture::fromQGesture(const QWidget *w, const QGesture *source)
{
- Gesture *result = Q_NULLPTR;
+ Gesture *result = nullptr;
switch (source->gestureType()) {
case Qt::TapGesture:
case Qt::TapAndHoldGesture:
diff --git a/tests/manual/widgets/styles/main.cpp b/tests/manual/widgets/styles/main.cpp
index 7c840dc9ae..7df54baef5 100644
--- a/tests/manual/widgets/styles/main.cpp
+++ b/tests/manual/widgets/styles/main.cpp
@@ -87,7 +87,7 @@ static QWidget *createStandardPixmapPage(QWidget *parent)
const int maxColumns = 6;
for (int i = 0; i <= int(QStyle::SP_LineEditClearButton); ++i) {
const QStyle::StandardPixmap sp = static_cast<QStyle::StandardPixmap>(i);
- QPixmap pixmap = result->style()->standardPixmap(sp, Q_NULLPTR, result);
+ QPixmap pixmap = result->style()->standardPixmap(sp, nullptr, result);
QLabel *descriptionLabel = new QLabel(pixmapDescription(sp, pixmap));
grid->addWidget(descriptionLabel, row, column++);
QLabel *displayLabel = new QLabel;
@@ -111,7 +111,7 @@ static QWidget *createMetricsPage(QWidget *parent)
for (int i = 0; i <= int(QStyle::PM_HeaderDefaultSectionSizeVertical); ++i) {
const QStyle::PixelMetric m = static_cast<QStyle::PixelMetric>(i);
str << formatEnumValue(m) << '(' << int(m) << ")="
- << result->style()->pixelMetric(m, Q_NULLPTR, result) << '\n';
+ << result->style()->pixelMetric(m, nullptr, result) << '\n';
}
result->setPlainText(text);
return result;
@@ -126,7 +126,7 @@ static QWidget *createHintsPage(QWidget *parent)
for (int i = 0; i <= int(QStyle::SH_Menu_SubMenuDontStartSloppyOnLeave); ++i) {
const QStyle::StyleHint h = static_cast<QStyle::StyleHint>(i);
str << formatEnumValue(h) << '(' << int(h) << ")="
- << result->style()->styleHint(h, Q_NULLPTR, result) << '\n';
+ << result->style()->styleHint(h, nullptr, result) << '\n';
}
result->setPlainText(text);
return result;