summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-07 13:05:48 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-07 23:02:47 +0200
commit564b59d903683b14c75b72a3e93367717f201def (patch)
tree03ffe749d83dce84429a7db484bf92795047036f /tests/auto
parentb5fc1e4e2643e73d3b44c483d159529f8deb8af1 (diff)
Another round of replacing 0 with nullptr
This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/cmake/test(needsquoting)dirname/mywidget.h2
-rw-r--r--tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp2
-rw-r--r--tests/auto/cmake/test_add_big_resource/myobject.h2
-rw-r--r--tests/auto/cmake/test_add_resource_options/myobject.h2
-rw-r--r--tests/auto/cmake/test_dbus_module/mydbusobject.h2
-rw-r--r--tests/auto/cmake/test_dependent_modules/mywidget.h2
-rw-r--r--tests/auto/cmake/test_interface/mainwindow.h2
-rw-r--r--tests/auto/cmake/test_interface_link_libraries/somelib.h2
-rw-r--r--tests/auto/cmake/test_json_plugin_includes/plugin.h2
-rw-r--r--tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp2
-rw-r--r--tests/auto/cmake/test_moc_macro_target/mywrapobject.h2
-rw-r--r--tests/auto/cmake/test_qtmainwin_library/myobject.h2
-rw-r--r--tests/auto/cmake/test_testlib_definitions/main.cpp2
-rw-r--r--tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h2
-rw-r--r--tests/auto/cmake/test_wrap_cpp_options/myobject.h2
-rw-r--r--tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp4
-rw-r--r--tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp2
-rw-r--r--tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp2
-rw-r--r--tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp2
-rw-r--r--tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp2
-rw-r--r--tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp4
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp2
-rw-r--r--tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp2
-rw-r--r--tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp14
-rw-r--r--tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp6
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/tst_qsortfilterproxymodel_recursive.cpp2
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp6
-rw-r--r--tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp8
-rw-r--r--tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp22
-rw-r--r--tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp2
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp16
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp34
-rw-r--r--tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp14
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp18
-rw-r--r--tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp2
-rw-r--r--tests/auto/corelib/serialization/qxmlstream/qc14n.h2
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp2
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring.cpp2
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp4
-rw-r--r--tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp2
-rw-r--r--tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp6
-rw-r--r--tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp2
-rw-r--r--tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp2
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp10
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp6
-rw-r--r--tests/auto/corelib/tools/collections/tst_collections.cpp12
-rw-r--r--tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp16
-rw-r--r--tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp2
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp4
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp2
-rw-r--r--tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h8
-rw-r--r--tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp2
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp2
-rw-r--r--tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp2
-rw-r--r--tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp2
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp2
-rw-r--r--tests/auto/gui/util/qundogroup/tst_qundogroup.cpp6
-rw-r--r--tests/auto/gui/util/qundostack/tst_qundostack.cpp14
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp2
-rw-r--r--tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp8
-rw-r--r--tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp4
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp6
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp6
-rw-r--r--tests/auto/network/socket/qtcpsocket/stressTest/Test.h2
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp4
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp2
-rw-r--r--tests/auto/other/gestures/tst_gestures.cpp10
-rw-r--r--tests/auto/other/macgui/guitest.h2
-rw-r--r--tests/auto/other/macnativeevents/nativeeventlist.h2
-rw-r--r--tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h10
-rw-r--r--tests/auto/other/qaccessibility/accessiblewidgets.h2
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp8
-rw-r--r--tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp2
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp6
-rw-r--r--tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp8
-rw-r--r--tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp4
-rw-r--r--tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp4
-rw-r--r--tests/auto/tools/moc/cxx11-explicit-override-control.h18
-rw-r--r--tests/auto/tools/moc/cxx11-final-classes.h18
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp20
-rw-r--r--tests/auto/tools/qdbuscpp2xml/test1.h2
-rw-r--r--tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp4
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp4
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp18
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard_2.cpp6
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp19
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp18
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp10
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp12
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp6
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp10
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp17
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp4
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp8
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp12
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp22
-rw-r--r--tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp4
-rw-r--r--tests/auto/widgets/kernel/qwidgetmetatype/tst_qwidgetmetatype.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp2
-rw-r--r--tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp2
-rw-r--r--tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp18
-rw-r--r--tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp2
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp4
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp2
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp4
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp8
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp8
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp4
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp4
-rw-r--r--tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp2
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp4
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp4
-rw-r--r--tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp6
-rw-r--r--tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp2
126 files changed, 372 insertions, 368 deletions
diff --git a/tests/auto/cmake/test(needsquoting)dirname/mywidget.h b/tests/auto/cmake/test(needsquoting)dirname/mywidget.h
index 5f3d59b7c0..dfa65a8503 100644
--- a/tests/auto/cmake/test(needsquoting)dirname/mywidget.h
+++ b/tests/auto/cmake/test(needsquoting)dirname/mywidget.h
@@ -40,7 +40,7 @@ class MyWidget : public QWidget
{
Q_OBJECT
public:
- MyWidget(QWidget *parent = 0);
+ MyWidget(QWidget *parent = nullptr);
signals:
void someSignal();
diff --git a/tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp b/tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp
index 4e73598200..56996814c2 100644
--- a/tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp
+++ b/tests/auto/cmake/test_QFINDTESTDATA/tests/main.cpp
@@ -33,7 +33,7 @@ class TestClass : public QObject
{
Q_OBJECT
public:
- TestClass(QObject* parent = 0) {}
+ TestClass(QObject* parent = nullptr) {}
private slots:
void doTest();
diff --git a/tests/auto/cmake/test_add_big_resource/myobject.h b/tests/auto/cmake/test_add_big_resource/myobject.h
index b6fbce32cd..c5b32c680d 100644
--- a/tests/auto/cmake/test_add_big_resource/myobject.h
+++ b/tests/auto/cmake/test_add_big_resource/myobject.h
@@ -35,7 +35,7 @@ class MyObject : public QObject
{
Q_OBJECT
public:
- MyObject(QObject *parent = 0);
+ MyObject(QObject *parent = nullptr);
signals:
void someSignal();
diff --git a/tests/auto/cmake/test_add_resource_options/myobject.h b/tests/auto/cmake/test_add_resource_options/myobject.h
index b6fbce32cd..c5b32c680d 100644
--- a/tests/auto/cmake/test_add_resource_options/myobject.h
+++ b/tests/auto/cmake/test_add_resource_options/myobject.h
@@ -35,7 +35,7 @@ class MyObject : public QObject
{
Q_OBJECT
public:
- MyObject(QObject *parent = 0);
+ MyObject(QObject *parent = nullptr);
signals:
void someSignal();
diff --git a/tests/auto/cmake/test_dbus_module/mydbusobject.h b/tests/auto/cmake/test_dbus_module/mydbusobject.h
index cc6b5626de..5a2c69cdae 100644
--- a/tests/auto/cmake/test_dbus_module/mydbusobject.h
+++ b/tests/auto/cmake/test_dbus_module/mydbusobject.h
@@ -36,7 +36,7 @@ class MyDBusObject : public QObject
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.qtProject.Tests.MyDBusObject")
public:
- MyDBusObject(QObject *parent = 0);
+ MyDBusObject(QObject *parent = nullptr);
signals:
void someSignal();
diff --git a/tests/auto/cmake/test_dependent_modules/mywidget.h b/tests/auto/cmake/test_dependent_modules/mywidget.h
index 5f3d59b7c0..dfa65a8503 100644
--- a/tests/auto/cmake/test_dependent_modules/mywidget.h
+++ b/tests/auto/cmake/test_dependent_modules/mywidget.h
@@ -40,7 +40,7 @@ class MyWidget : public QWidget
{
Q_OBJECT
public:
- MyWidget(QWidget *parent = 0);
+ MyWidget(QWidget *parent = nullptr);
signals:
void someSignal();
diff --git a/tests/auto/cmake/test_interface/mainwindow.h b/tests/auto/cmake/test_interface/mainwindow.h
index 246ab47d16..2dd52efd01 100644
--- a/tests/auto/cmake/test_interface/mainwindow.h
+++ b/tests/auto/cmake/test_interface/mainwindow.h
@@ -35,7 +35,7 @@ class MainWindow : public QWidget
{
Q_OBJECT
public:
- MainWindow(QWidget *parent = 0);
+ MainWindow(QWidget *parent = nullptr);
signals:
void somethingHappened();
diff --git a/tests/auto/cmake/test_interface_link_libraries/somelib.h b/tests/auto/cmake/test_interface_link_libraries/somelib.h
index 0a9d6a8394..9cad2931af 100644
--- a/tests/auto/cmake/test_interface_link_libraries/somelib.h
+++ b/tests/auto/cmake/test_interface_link_libraries/somelib.h
@@ -37,7 +37,7 @@ class SOMELIB_EXPORT SomeObject : QTextDocument
{
Q_OBJECT
public:
- explicit SomeObject(QObject *parent = 0);
+ explicit SomeObject(QObject *parent = nullptr);
int value();
};
diff --git a/tests/auto/cmake/test_json_plugin_includes/plugin.h b/tests/auto/cmake/test_json_plugin_includes/plugin.h
index 3fdb5aeb64..79ec252734 100644
--- a/tests/auto/cmake/test_json_plugin_includes/plugin.h
+++ b/tests/auto/cmake/test_json_plugin_includes/plugin.h
@@ -36,7 +36,7 @@ class JsonTestPlugin : public QObject
Q_OBJECT
Q_PLUGIN_METADATA(IID "JsonTestPlugin" FILE "jsontestplugin.json")
public:
- JsonTestPlugin(QObject *parent = 0);
+ JsonTestPlugin(QObject *parent = nullptr);
};
#endif
diff --git a/tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp b/tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp
index ca4134608a..3e6c4acd4e 100644
--- a/tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp
+++ b/tests/auto/cmake/test_moc_macro_target/main_gen_test.cpp
@@ -35,7 +35,7 @@ class MyObject : public QObject, MyInterface
Q_OBJECT
Q_INTERFACES(MyInterface)
public:
- explicit MyObject(QObject *parent = 0) : QObject(parent) { }
+ explicit MyObject(QObject *parent = nullptr) : QObject(parent) { }
};
int main(int argc, char **argv)
diff --git a/tests/auto/cmake/test_moc_macro_target/mywrapobject.h b/tests/auto/cmake/test_moc_macro_target/mywrapobject.h
index adc7551120..a4be007110 100644
--- a/tests/auto/cmake/test_moc_macro_target/mywrapobject.h
+++ b/tests/auto/cmake/test_moc_macro_target/mywrapobject.h
@@ -38,7 +38,7 @@ class MyWrapObject : public QObject, MyInterface
Q_OBJECT
Q_INTERFACES(MyInterface)
public:
- explicit MyWrapObject(QObject *parent = 0) : QObject(parent) { }
+ explicit MyWrapObject(QObject *parent = nullptr) : QObject(parent) { }
};
#endif
diff --git a/tests/auto/cmake/test_qtmainwin_library/myobject.h b/tests/auto/cmake/test_qtmainwin_library/myobject.h
index f916675817..df0e377a60 100644
--- a/tests/auto/cmake/test_qtmainwin_library/myobject.h
+++ b/tests/auto/cmake/test_qtmainwin_library/myobject.h
@@ -35,7 +35,7 @@ class MyObject : public QObject
{
Q_OBJECT
public:
- MyObject(QObject *parent = 0);
+ MyObject(QObject *parent = nullptr);
signals:
void someSignal();
diff --git a/tests/auto/cmake/test_testlib_definitions/main.cpp b/tests/auto/cmake/test_testlib_definitions/main.cpp
index 1ba9f2fc3b..45dd97f3c5 100644
--- a/tests/auto/cmake/test_testlib_definitions/main.cpp
+++ b/tests/auto/cmake/test_testlib_definitions/main.cpp
@@ -33,7 +33,7 @@ class TestObject : public QObject
{
Q_OBJECT
public:
- TestObject(QObject *parent = 0)
+ TestObject(QObject *parent = nullptr)
: QObject(parent)
{
diff --git a/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h b/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h
index b6fbce32cd..c5b32c680d 100644
--- a/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h
+++ b/tests/auto/cmake/test_wrap_cpp_and_resources/myobject.h
@@ -35,7 +35,7 @@ class MyObject : public QObject
{
Q_OBJECT
public:
- MyObject(QObject *parent = 0);
+ MyObject(QObject *parent = nullptr);
signals:
void someSignal();
diff --git a/tests/auto/cmake/test_wrap_cpp_options/myobject.h b/tests/auto/cmake/test_wrap_cpp_options/myobject.h
index b6fbce32cd..c5b32c680d 100644
--- a/tests/auto/cmake/test_wrap_cpp_options/myobject.h
+++ b/tests/auto/cmake/test_wrap_cpp_options/myobject.h
@@ -35,7 +35,7 @@ class MyObject : public QObject
{
Q_OBJECT
public:
- MyObject(QObject *parent = 0);
+ MyObject(QObject *parent = nullptr);
signals:
void someSignal();
diff --git a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
index a39488fd62..6825be19e6 100644
--- a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
+++ b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
@@ -415,7 +415,7 @@ void tst_QtConcurrentThreadEngine::cancelQueuedSlowUser()
class QtConcurrentExceptionThrower : public ThreadEngine<void>
{
public:
- QtConcurrentExceptionThrower(QThread *blockThread = 0)
+ QtConcurrentExceptionThrower(QThread *blockThread = nullptr)
: ThreadEngine(QThreadPool::globalInstance())
{
this->blockThread = blockThread;
@@ -433,7 +433,7 @@ public:
class UnrelatedExceptionThrower : public ThreadEngine<void>
{
public:
- UnrelatedExceptionThrower(QThread *blockThread = 0)
+ UnrelatedExceptionThrower(QThread *blockThread = nullptr)
: ThreadEngine(QThreadPool::globalInstance())
{
this->blockThread = blockThread;
diff --git a/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp
index cf46d5c14e..fd1e288b4d 100644
--- a/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp
+++ b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp
@@ -92,7 +92,7 @@ class UncontrolledAnimation : public QPropertyAnimation
{
Q_OBJECT
public:
- UncontrolledAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = 0)
+ UncontrolledAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = nullptr)
: QPropertyAnimation(target, propertyName, parent), id(0)
{
setDuration(250);
diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
index fa30659d89..dab7a8cd6f 100644
--- a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
+++ b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
@@ -127,7 +127,7 @@ class UncontrolledAnimation : public QPropertyAnimation
{
Q_OBJECT
public:
- UncontrolledAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = 0)
+ UncontrolledAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = nullptr)
: QPropertyAnimation(target, propertyName, parent), id(0)
{
setDuration(250);
diff --git a/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp
index a38f3d221d..5f2923f498 100644
--- a/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp
+++ b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp
@@ -56,7 +56,7 @@ class TestablePauseAnimation : public QPauseAnimation
{
Q_OBJECT
public:
- TestablePauseAnimation(QObject *parent = 0)
+ TestablePauseAnimation(QObject *parent = nullptr)
: QPauseAnimation(parent),
m_updateCurrentTimeCount(0)
{
diff --git a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp
index 8a4d05ed96..f5cff8a2e0 100644
--- a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -65,7 +65,7 @@ private:
class DummyPropertyAnimation : public QPropertyAnimation
{
public:
- DummyPropertyAnimation(QObject *parent = 0) : QPropertyAnimation(parent)
+ DummyPropertyAnimation(QObject *parent = nullptr) : QPropertyAnimation(parent)
{
setTargetObject(&o);
this->setPropertyName("x");
diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
index 008ac696fc..1a03254e0b 100644
--- a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
+++ b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
@@ -108,7 +108,7 @@ public:
class DummyPropertyAnimation : public QPropertyAnimation
{
public:
- DummyPropertyAnimation(QObject *parent = 0) : QPropertyAnimation(parent)
+ DummyPropertyAnimation(QObject *parent = nullptr) : QPropertyAnimation(parent)
{
setTargetObject(&o);
this->setPropertyName("value");
@@ -122,7 +122,7 @@ class UncontrolledAnimation : public QPropertyAnimation
{
Q_OBJECT
public:
- UncontrolledAnimation(QObject *target, QObject *parent = 0)
+ UncontrolledAnimation(QObject *target, QObject *parent = nullptr)
: QPropertyAnimation(target, "value", parent)
{
setDuration(250);
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 4f07581587..72d0960473 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -722,7 +722,7 @@ public:
SignalReceiver(const QDir &moveSrcDir,
const QString &moveDestination,
QFileSystemWatcher *watcher,
- QObject *parent = 0)
+ QObject *parent = nullptr)
: QObject(parent),
added(false),
moveSrcDir(moveSrcDir),
diff --git a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
index cc73eac9c8..e45c13b9b9 100644
--- a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
+++ b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
@@ -820,7 +820,7 @@ private slots:
{
_config->clear();
_config->addKey("LoggingCategoryObject", true);
- QLoggingCategory *pcategorybject = 0;
+ QLoggingCategory *pcategorybject = nullptr;
QLoggingCategory::setFilterRules(_config->array());
{
QLoggingCategory mycategoryobject("LoggingCategoryObject");
diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
index 5d384de2b2..bf44cf5fa0 100644
--- a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
@@ -132,8 +132,8 @@ private:
class QtTestModel: public QAbstractItemModel
{
public:
- QtTestModel(int rows, int columns, QObject *parent = 0);
- QtTestModel(const QList<QList<QString> > tbl, QObject *parent = 0);
+ QtTestModel(int rows, int columns, QObject *parent = nullptr);
+ QtTestModel(const QList<QList<QString> > tbl, QObject *parent = nullptr);
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &) const override;
int rowCount(const QModelIndex &parent) const override;
@@ -1940,7 +1940,7 @@ public:
UserRole
};
- CustomRoleModel(QObject *parent = 0)
+ CustomRoleModel(QObject *parent = nullptr)
: QStringListModel(QStringList() << "a" << "b" << "c", parent)
{
}
@@ -1991,7 +1991,7 @@ class SignalArgumentChecker : public QObject
{
Q_OBJECT
public:
- SignalArgumentChecker(const QModelIndex &p1, const QModelIndex &p2, QObject *parent = 0)
+ SignalArgumentChecker(const QModelIndex &p1, const QModelIndex &p2, QObject *parent = nullptr)
: QObject(parent), m_p1(p1), m_p2(p2), m_p1Persistent(p1), m_p2Persistent(p2)
{
connect(p1.model(), SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>)), SLOT(layoutAboutToBeChanged(QList<QPersistentModelIndex>)));
@@ -2165,7 +2165,7 @@ class OverrideRoleNamesAndDragActions : public QStringListModel
{
Q_OBJECT
public:
- OverrideRoleNamesAndDragActions(QObject *parent = 0)
+ OverrideRoleNamesAndDragActions(QObject *parent = nullptr)
: QStringListModel(parent)
{
@@ -2204,7 +2204,7 @@ class OverrideDropActions : public QStringListModel
{
Q_OBJECT
public:
- OverrideDropActions(QObject *parent = 0)
+ OverrideDropActions(QObject *parent = nullptr)
: QStringListModel(parent)
{
}
@@ -2225,7 +2225,7 @@ class SignalConnectionTester : public QObject
{
Q_OBJECT
public:
- SignalConnectionTester(QObject *parent = 0)
+ SignalConnectionTester(QObject *parent = nullptr)
: QObject(parent), testPassed(false)
{
diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
index 313facac81..92f9c87b9f 100644
--- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -2092,7 +2092,7 @@ class QtTestTableModel: public QAbstractTableModel
{
Q_OBJECT
public:
- QtTestTableModel(int rows = 0, int columns = 0, QObject *parent = 0)
+ QtTestTableModel(int rows = 0, int columns = 0, QObject *parent = nullptr)
: QAbstractTableModel(parent)
, row_count(rows)
, column_count(columns)
@@ -2624,7 +2624,7 @@ class SelectionObserver : public QObject
{
Q_OBJECT
public:
- SelectionObserver(QAbstractItemModel *model, QObject *parent = 0)
+ SelectionObserver(QAbstractItemModel *model, QObject *parent = nullptr)
: QObject(parent), m_model(model), m_selectionModel(0)
{
connect(model, SIGNAL(modelReset()), SLOT(modelReset()));
@@ -2688,7 +2688,7 @@ class DuplicateItemSelectionModel : public QItemSelectionModel
{
Q_OBJECT
public:
- DuplicateItemSelectionModel(QItemSelectionModel *target, QAbstractItemModel *model, QObject *parent = 0)
+ DuplicateItemSelectionModel(QItemSelectionModel *target, QAbstractItemModel *model, QObject *parent = nullptr)
: QItemSelectionModel(model, parent), m_target(target)
{
}
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/tst_qsortfilterproxymodel_recursive.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/tst_qsortfilterproxymodel_recursive.cpp
index 35ae7f4a7f..d6a09056ae 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/tst_qsortfilterproxymodel_recursive.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_recursive/tst_qsortfilterproxymodel_recursive.cpp
@@ -142,7 +142,7 @@ static QString treeAsString(const QAbstractItemModel &model, const QModelIndex &
static void fillModel(QStandardItemModel &model, const QString &str)
{
QCOMPARE(str.count('['), str.count(']'));
- QStandardItem *item = 0;
+ QStandardItem *item = nullptr;
QString data;
for ( int i = 0 ; i < str.length() ; ++i ) {
const QChar ch = str.at(i);
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 8b3d0503df..3b87f8fabf 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -824,13 +824,13 @@ class JobObject : public QObject
Q_OBJECT
public:
- explicit JobObject(QEventLoop *loop, QObject *parent = 0)
+ explicit JobObject(QEventLoop *loop, QObject *parent = nullptr)
: QObject(parent), locker(loop)
{
QTimer::singleShot(1000, this, SLOT(timeout()));
}
- explicit JobObject(QObject *parent = 0)
+ explicit JobObject(QObject *parent = nullptr)
: QObject(parent)
{
QTimer::singleShot(1000, this, SLOT(timeout()));
@@ -860,7 +860,7 @@ class QuitTester : public QObject
{
Q_OBJECT
public:
- QuitTester(QObject *parent = 0)
+ QuitTester(QObject *parent = nullptr)
: QObject(parent)
{
QTimer::singleShot(0, this, SLOT(doTest()));
diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
index 3765b6fbf8..9d1153fe47 100644
--- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
@@ -86,7 +86,7 @@ void EventLoopThread::run()
emit checkPoint();
(void) eventLoop->exec();
delete eventLoop;
- eventLoop = 0;
+ eventLoop = nullptr;
}
class MultipleExecThread : public QThread
@@ -126,7 +126,7 @@ public:
class StartStopEvent: public QEvent
{
public:
- explicit StartStopEvent(int type, QEventLoop *loop = 0)
+ explicit StartStopEvent(int type, QEventLoop *loop = nullptr)
: QEvent(Type(type)), el(loop)
{ }
@@ -602,12 +602,12 @@ class JobObject : public QObject
Q_OBJECT
public:
- explicit JobObject(QEventLoop *loop, QObject *parent = 0)
+ explicit JobObject(QEventLoop *loop, QObject *parent = nullptr)
: QObject(parent), locker(loop)
{
}
- explicit JobObject(QObject *parent = 0)
+ explicit JobObject(QObject *parent = nullptr)
: QObject(parent)
{
}
diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
index fde1255443..c073e2d77f 100644
--- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
@@ -90,7 +90,7 @@ namespace MyNamespace {
MyFlags myFlags() const { return m_flags; }
void setMyFlags(MyFlags val) { m_flags = val; }
- MyClass(QObject *parent = 0)
+ MyClass(QObject *parent = nullptr)
: QObject(parent),
m_enum(MyEnum1),
m_flags(MyFlag1|MyFlag2)
@@ -139,7 +139,7 @@ namespace MyNamespace {
MyFlags myFlags() const { return m_flags; }
void setMyFlags(MyFlags val) { m_flags = val; }
- MyClass2(QObject *parent = 0)
+ MyClass2(QObject *parent = nullptr)
: QObject(parent),
m_enum(MyEnum1),
m_flags(MyFlag1|MyFlag2)
@@ -699,24 +699,24 @@ void tst_QMetaObject::invokeMetaMember()
QCOMPARE(exp, QString("yessir"));
QCOMPARE(obj.slotResult, QString("sl1:bubu"));
- QObject *ptr = 0;
+ QObject *ptr = nullptr;
QVERIFY(QMetaObject::invokeMethod(&obj, "sl11", Q_RETURN_ARG(QObject*,ptr)));
QCOMPARE(ptr, (QObject *)&obj);
QCOMPARE(obj.slotResult, QString("sl11"));
// try again with a space:
- ptr = 0;
+ ptr = nullptr;
QVERIFY(QMetaObject::invokeMethod(&obj, "sl11", Q_RETURN_ARG(QObject * , ptr)));
QCOMPARE(ptr, (QObject *)&obj);
QCOMPARE(obj.slotResult, QString("sl11"));
- const char *ptr2 = 0;
+ const char *ptr2 = nullptr;
QVERIFY(QMetaObject::invokeMethod(&obj, "sl12", Q_RETURN_ARG(const char*, ptr2)));
- QVERIFY(ptr2 != 0);
+ QVERIFY(ptr2 != nullptr);
QCOMPARE(obj.slotResult, QString("sl12"));
// try again with a space:
- ptr2 = 0;
+ ptr2 = nullptr;
QVERIFY(QMetaObject::invokeMethod(&obj, "sl12", Q_RETURN_ARG(char const * , ptr2)));
- QVERIFY(ptr2 != 0);
+ QVERIFY(ptr2 != nullptr);
QCOMPARE(obj.slotResult, QString("sl12"));
// test w/ template args
@@ -1022,12 +1022,12 @@ void tst_QMetaObject::invokeBlockingQueuedMetaMember()
QCOMPARE(exp, QString("yessir"));
QCOMPARE(obj.slotResult, QString("sl1:bubu"));
- QObject *ptr = 0;
+ QObject *ptr = nullptr;
QVERIFY(QMetaObject::invokeMethod(&obj, "sl11", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QObject*,ptr)));
QCOMPARE(ptr, (QObject *)&obj);
QCOMPARE(obj.slotResult, QString("sl11"));
// try again with a space:
- ptr = 0;
+ ptr = nullptr;
QVERIFY(QMetaObject::invokeMethod(&obj, "sl11", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QObject * , ptr)));
QCOMPARE(ptr, (QObject *)&obj);
QCOMPARE(obj.slotResult, QString("sl11"));
@@ -1218,7 +1218,7 @@ class ConstructibleClass : public QObject
{
Q_OBJECT
public:
- Q_INVOKABLE ConstructibleClass(QObject *parent = 0)
+ Q_INVOKABLE ConstructibleClass(QObject *parent = nullptr)
: QObject(parent) {}
};
diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
index 333c7931d9..2a26f5c4c2 100644
--- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
+++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
@@ -1350,7 +1350,7 @@ private:
//Q_PROPERTY(int intProp READ intProp WRITE setIntProp NOTIFY intPropChanged)
public:
- TestObject(QObject *parent = 0); // Q_INVOKABLE
+ TestObject(QObject *parent = nullptr); // Q_INVOKABLE
~TestObject();
// Property accessors
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index ca215386fb..f116684f5b 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -367,7 +367,7 @@ class CustomQObject : public QObject
{
Q_OBJECT
public:
- CustomQObject(QObject *parent = 0)
+ CustomQObject(QObject *parent = nullptr)
: QObject(parent)
{
}
@@ -1017,7 +1017,7 @@ class CustomObject : public QObject
{
Q_OBJECT
public:
- CustomObject(QObject *parent = 0)
+ CustomObject(QObject *parent = nullptr)
: QObject(parent)
{
@@ -1031,7 +1031,7 @@ class CustomMultiInheritanceObject : public QObject, SecondBase
{
Q_OBJECT
public:
- CustomMultiInheritanceObject(QObject *parent = 0)
+ CustomMultiInheritanceObject(QObject *parent = nullptr)
: QObject(parent)
{
@@ -1605,7 +1605,7 @@ class AutoMetaTypeObject : public QObject
Q_PROPERTY(IntIntHash someHash READ someHash CONSTANT)
Q_PROPERTY(NaturalNumber someInt READ someInt CONSTANT)
public:
- AutoMetaTypeObject(QObject *parent = 0)
+ AutoMetaTypeObject(QObject *parent = nullptr)
: QObject(parent), m_int(42)
{
m_hash.insert(4, 2);
@@ -1630,7 +1630,7 @@ class MyObject : public QObject
{
Q_OBJECT
public:
- MyObject(QObject *parent = 0)
+ MyObject(QObject *parent = nullptr)
: QObject(parent)
{
}
@@ -1781,7 +1781,7 @@ void tst_QMetaType::automaticTemplateRegistration()
{
typedef std::map<int, CustomObject*> StdMapIntCustomObject ;
StdMapIntCustomObject intComparableMap;
- CustomObject *o = 0;
+ CustomObject *o = nullptr;
intComparableMap[4] = o;
QCOMPARE(QVariant::fromValue(intComparableMap).value<StdMapIntCustomObject >()[4], o);
}
@@ -1822,7 +1822,7 @@ void tst_QMetaType::automaticTemplateRegistration()
}
{
typedef std::pair<int, CustomQObject*> StdIntComparablePair;
- CustomQObject* o = 0;
+ CustomQObject *o = nullptr;
StdIntComparablePair intComparablePair = std::make_pair(4, o);
QCOMPARE(QVariant::fromValue(intComparablePair).value<StdIntComparablePair>().first, 4);
QCOMPARE(QVariant::fromValue(intComparablePair).value<StdIntComparablePair>().second, o);
@@ -2099,7 +2099,7 @@ class MyQObjectFromGadget : public QObject, public MyGadget
{
Q_OBJECT
public:
- MyQObjectFromGadget(QObject *parent = 0)
+ MyQObjectFromGadget(QObject *parent = nullptr)
: QObject(parent)
{}
};
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 51df41f5ac..f4c028c83e 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -537,7 +537,7 @@ void tst_QObject::findChildren()
Q_SET_OBJECT_NAME(t121);
emptyname.setObjectName("");
- QObject *op = 0;
+ QObject *op = nullptr;
op = o.findChild<QObject*>("o1");
QCOMPARE(op, &o1);
@@ -1430,7 +1430,7 @@ class QCustomTypeChecker: public QObject
Q_OBJECT
public:
- QCustomTypeChecker(QObject *parent = 0): QObject(parent) {}
+ QCustomTypeChecker(QObject *parent = nullptr): QObject(parent) {}
void doEmit(CustomType ct)
{ emit signal1(ct); }
@@ -1638,8 +1638,8 @@ void tst_QObject::thread()
QCOMPARE(child.thread(), object.thread());
}
- QObject *object = 0;
- QObject *child = 0;
+ QObject *object = nullptr;
+ QObject *child = nullptr;
{
TestThread thr;
@@ -1681,12 +1681,12 @@ class MoveToThreadObject : public QObject
{
Q_OBJECT
public:
- QThread *timerEventThread;
- QThread *customEventThread;
- QThread *slotThread;
+ QThread *timerEventThread = nullptr;
+ QThread *customEventThread = nullptr;
+ QThread *slotThread = nullptr;
- MoveToThreadObject(QObject *parent = 0)
- : QObject(parent), timerEventThread(0), customEventThread(0), slotThread(0)
+ MoveToThreadObject(QObject *parent = nullptr)
+ : QObject(parent)
{ }
void customEvent(QEvent *) override
@@ -1969,7 +1969,7 @@ void tst_QObject::property()
QCOMPARE(property.type(), QVariant::UserType);
QCOMPARE(property.userType(), qMetaTypeId<CustomType*>());
- CustomType *customPointer = 0;
+ CustomType *customPointer = nullptr;
QVariant customVariant = object.property("custom");
customPointer = qvariant_cast<CustomType *>(customVariant);
QCOMPARE(customPointer, object.custom());
@@ -2166,7 +2166,7 @@ public:
SuperObject()
{
- theSender = 0;
+ theSender = nullptr;
theSignalId = 0;
}
@@ -2230,7 +2230,7 @@ void tst_QObject::senderTest()
QCOMPARE(receiver->sender(), (QObject *)0);
QCOMPARE(receiver->senderSignalIndex(), -1);
- receiver->theSender = 0;
+ receiver->theSender = nullptr;
receiver->theSignalId = -1;
thread.start();
emit sender->theSignal();
@@ -3046,7 +3046,7 @@ class EventSpy : public QObject
public:
typedef QList<QPair<QObject *, QEvent::Type> > EventList;
- EventSpy(QObject *parent = 0)
+ EventSpy(QObject *parent = nullptr)
: QObject(parent)
{ }
@@ -3582,9 +3582,9 @@ class OverloadObject : public QObject
signals:
void sig(int i, char c, qreal m = 12);
void sig(int i, int j = 12);
- void sig(QObject *o, QObject *p, QObject *q = 0, QObject *r = 0) const;
+ void sig(QObject *o, QObject *p, QObject *q = nullptr, QObject *r = nullptr) const;
void other(int a = 0);
- void sig(QObject *o, OverloadObject *p = 0, QObject *q = 0, QObject *r = nullptr);
+ void sig(QObject *o, OverloadObject *p = nullptr, QObject *q = nullptr, QObject *r = nullptr);
void sig(double r = 0.5);
public slots:
void slo(int i, int j = 43)
@@ -6160,7 +6160,7 @@ public slots:
{
if (abouttoblock) {
abouttoblock->deleteLater();
- abouttoblock = 0;
+ abouttoblock = nullptr;
}
++m_aboutToBlocks;
}
@@ -6168,7 +6168,7 @@ public slots:
{
if (awake) {
awake->deleteLater();
- awake = 0;
+ awake = nullptr;
}
++m_awakes;
diff --git a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
index ba973910a7..63e2f25d1d 100644
--- a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
+++ b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
@@ -98,7 +98,7 @@ void tst_QPointer::assignment_operators()
QCOMPARE(p1, QPointer<QObject>(p2));
// Test assignment with a null pointer
- p1 = 0;
+ p1 = nullptr;
p2 = p1;
QCOMPARE(p1, QPointer<QObject>(0));
QCOMPARE(p2, QPointer<QObject>(0));
@@ -131,9 +131,9 @@ void tst_QPointer::equality_operators()
QVERIFY(p1 == p2);
- QObject *object = 0;
+ QObject *object = nullptr;
#ifndef QT_NO_WIDGETS
- QWidget *widget = 0;
+ QWidget *widget = nullptr;
#endif
p1 = object;
@@ -149,11 +149,15 @@ void tst_QPointer::equality_operators()
QVERIFY(p1 == p2);
// compare to zero
- p1 = 0;
+ p1 = nullptr;
QVERIFY(p1 == 0);
QVERIFY(0 == p1);
QVERIFY(p2 != 0);
QVERIFY(0 != p2);
+ QVERIFY(p1 == nullptr);
+ QVERIFY(nullptr == p1);
+ QVERIFY(p2 != nullptr);
+ QVERIFY(nullptr != p2);
QVERIFY(p1 == object);
QVERIFY(object == p1);
QVERIFY(p2 != object);
@@ -188,7 +192,7 @@ void tst_QPointer::isNull()
QVERIFY(p1.isNull());
p1 = this;
QVERIFY(!p1.isNull());
- p1 = 0;
+ p1 = nullptr;
QVERIFY(p1.isNull());
}
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index ea8f26ae20..251bb803b4 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -64,7 +64,7 @@ class tst_QVariant : public QObject
Q_OBJECT
public:
- tst_QVariant(QObject *parent = 0)
+ tst_QVariant(QObject *parent = nullptr)
: QObject(parent), customNonQObjectPointer(0)
{
@@ -2288,7 +2288,7 @@ void tst_QVariant::variantHash()
class CustomQObject : public QObject {
Q_OBJECT
public:
- CustomQObject(QObject *parent = 0) : QObject(parent) {}
+ CustomQObject(QObject *parent = nullptr) : QObject(parent) {}
};
Q_DECLARE_METATYPE(CustomQObject*)
@@ -2346,7 +2346,7 @@ void tst_QVariant::qvariant_cast_QObject()
QVERIFY(data.canConvert<QObject*>());
QVERIFY(data.canConvert(QMetaType::QObjectStar));
QVERIFY(data.canConvert(::qMetaTypeId<QObject*>()));
- QCOMPARE(data.value<QObject*>() == 0, isNull);
+ QCOMPARE(data.value<QObject*>() == nullptr, isNull);
QVERIFY(data.convert(QMetaType::QObjectStar));
QCOMPARE(data.userType(), int(QMetaType::QObjectStar));
} else {
@@ -2362,14 +2362,14 @@ void tst_QVariant::qvariant_cast_QObject()
class CustomQObjectDerived : public CustomQObject {
Q_OBJECT
public:
- CustomQObjectDerived(QObject *parent = 0) : CustomQObject(parent) {}
+ CustomQObjectDerived(QObject *parent = nullptr) : CustomQObject(parent) {}
};
Q_DECLARE_METATYPE(CustomQObjectDerived*)
class CustomQObjectDerivedNoMetaType : public CustomQObject {
Q_OBJECT
public:
- CustomQObjectDerivedNoMetaType(QObject *parent = 0) : CustomQObject(parent) {}
+ CustomQObjectDerivedNoMetaType(QObject *parent = nullptr) : CustomQObject(parent) {}
};
void tst_QVariant::qvariant_cast_QObject_derived()
@@ -2404,7 +2404,7 @@ void tst_QVariant::qvariant_cast_QObject_derived()
struct QObjectWrapper
{
- explicit QObjectWrapper(QObject *o = 0) : obj(o) {}
+ explicit QObjectWrapper(QObject *o = nullptr) : obj(o) {}
QObject* getObject() const {
return obj;
@@ -2433,7 +2433,7 @@ class SmartPointer
T* pointer;
public:
typedef T element_type;
- explicit SmartPointer(T *t = 0)
+ explicit SmartPointer(T *t = nullptr)
: pointer(t)
{
}
@@ -2667,7 +2667,7 @@ void tst_QVariant::voidStar() const
v2 = QVariant::fromValue(p2);
QCOMPARE(v1, v2);
- p2 = 0;
+ p2 = nullptr;
v2 = QVariant::fromValue(p2);
QVERIFY(v1 != v2);
}
@@ -3705,7 +3705,7 @@ Q_DECLARE_METATYPE(Forward*)
void tst_QVariant::forwardDeclare()
{
- Forward *f = 0;
+ Forward *f = nullptr;
QVariant v = QVariant::fromValue(f);
QCOMPARE(qvariant_cast<Forward*>(v), f);
}
diff --git a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
index 1a2a2a5324..0710e257b8 100644
--- a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
@@ -2526,7 +2526,7 @@ void tst_QDataStream::skipRawData()
QFETCH(char, expect);
qint8 dummy;
- QIODevice *dev = 0;
+ QIODevice *dev = nullptr;
if (deviceType == "sequential") {
dev = new SequentialBuffer(&data);
} else if (deviceType == "random-access") {
diff --git a/tests/auto/corelib/serialization/qxmlstream/qc14n.h b/tests/auto/corelib/serialization/qxmlstream/qc14n.h
index e4056fb0db..7fb27382aa 100644
--- a/tests/auto/corelib/serialization/qxmlstream/qc14n.h
+++ b/tests/auto/corelib/serialization/qxmlstream/qc14n.h
@@ -36,7 +36,7 @@ class QC14N
public:
static bool isEqual(QIODevice *const firstDocument,
QIODevice *const secondDocument,
- QString *const message = 0);
+ QString *const message = nullptr);
private:
static bool isDifferent(const QXmlStreamReader &r1,
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
index 7d4cbbbcdd..7b69e2b8af 100644
--- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
@@ -1265,7 +1265,7 @@ void tst_QLocale::strtod()
QFETCH(bool, ok);
QByteArray numData = num_str.toLatin1();
- const char *end = 0;
+ const char *end = nullptr;
bool actualOk = false;
double result = qstrtod(numData.constData(), &end, &actualOk);
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
index 31f362888c..e63270bfe4 100644
--- a/tests/auto/corelib/text/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
@@ -4486,7 +4486,7 @@ void tst_QString::fromLatin1()
void tst_QString::fromUcs4()
{
- const char32_t *null = 0;
+ const char32_t *null = nullptr;
QString s;
s = QString::fromUcs4( null );
QVERIFY( s.isNull() );
diff --git a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp
index c1a208bc62..66dfe3ce58 100644
--- a/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp
@@ -261,7 +261,7 @@ void runScenario()
r = string P ba;
QCOMPARE(r, string);
- const char *zero = 0;
+ const char *zero = nullptr;
r = string P zero;
QCOMPARE(r, string);
r = zero P string;
@@ -300,7 +300,7 @@ void runScenario()
r2 = QByteArray("hello\0") P UTF8_LITERAL;
QCOMPARE(r, r2);
- const char *zero = 0;
+ const char *zero = nullptr;
r = ba P zero;
QCOMPARE(r, ba);
r = zero P ba;
diff --git a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
index ef00be31c5..260dbc30e8 100644
--- a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
+++ b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
@@ -85,7 +85,7 @@ private:
};
template <int I>
-static inline void assemblyMarker(void *ptr = 0)
+static inline void assemblyMarker(void *ptr = nullptr)
{
puts((char *)ptr + I);
}
diff --git a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp
index bcc34a7d96..4361609442 100644
--- a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp
+++ b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp
@@ -77,8 +77,8 @@ void tst_QAtomicPointer::warningFreeHelper()
p.loadRelaxed()->bar();
- WFHC *expectedValue = 0;
- WFHC *newValue = 0;
+ WFHC *expectedValue = nullptr;
+ WFHC *newValue = nullptr;
qptrdiff valueToAdd = 0;
p.testAndSetRelaxed(expectedValue, newValue);
@@ -585,7 +585,7 @@ void tst_QAtomicPointer::fetchAndAdd()
template <typename T> void constAndVolatile_helper()
{
- T *one = 0;
+ T *one = nullptr;
T *two = &one;
T *three = &two;
diff --git a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
index f984aec0e8..76e50eee1b 100644
--- a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
+++ b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
@@ -864,7 +864,7 @@ private:
void tst_QReadWriteLock::deleteOnUnlock()
{
- QReadWriteLock *lock = 0;
+ QReadWriteLock *lock = nullptr;
QWaitCondition startup;
QMutex waitMutex;
diff --git a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp
index cf27c23591..f556e402e3 100644
--- a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp
+++ b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp
@@ -49,7 +49,7 @@ private slots:
void raii();
};
-static QSemaphore *semaphore = 0;
+static QSemaphore *semaphore = nullptr;
class ThreadOne : public QThread
{
diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
index 235fb093b5..1e8380fbba 100644
--- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp
+++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
@@ -429,7 +429,7 @@ void tst_QThread::exit()
delete thread.object;
Exit_Thread thread2;
- thread2.object = 0;
+ thread2.object = nullptr;
thread2.code = 53;
thread2.result = 0;
QMutexLocker locker2(&thread2.mutex);
@@ -505,7 +505,7 @@ void tst_QThread::quit()
delete thread.object;
Quit_Thread thread2;
- thread2.object = 0;
+ thread2.object = nullptr;
thread2.result = -1;
QMutexLocker locker2(&thread2.mutex);
thread2.start();
@@ -647,8 +647,8 @@ class NativeThreadWrapper
{
public:
NativeThreadWrapper() : qthread(0), waitForStop(false) {}
- void start(FunctionPointer functionPointer = noop, void *data = 0);
- void startAndWait(FunctionPointer functionPointer = noop, void *data = 0);
+ void start(FunctionPointer functionPointer = noop, void *data = nullptr);
+ void startAndWait(FunctionPointer functionPointer = noop, void *data = nullptr);
void join();
void setWaitForStop() { waitForStop = true; }
void stop();
@@ -1289,7 +1289,7 @@ class Job : public QObject
{
Q_OBJECT
public:
- Job(QThread *thread, int deleteDelay, bool *flag, QObject *parent = 0)
+ Job(QThread *thread, int deleteDelay, bool *flag, QObject *parent = nullptr)
: QObject(parent), quitLocker(thread), exitThreadCalled(*flag)
{
exitThreadCalled = false;
diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
index 3054e3c5a4..e6db963c7b 100644
--- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
@@ -107,7 +107,7 @@ private:
};
-QMutex *tst_QThreadPool::functionTestMutex = 0;
+QMutex *tst_QThreadPool::functionTestMutex = nullptr;
tst_QThreadPool::tst_QThreadPool()
{
@@ -116,7 +116,7 @@ tst_QThreadPool::tst_QThreadPool()
tst_QThreadPool::~tst_QThreadPool()
{
- tst_QThreadPool::functionTestMutex = 0;
+ tst_QThreadPool::functionTestMutex = nullptr;
}
int testFunctionCount;
@@ -282,7 +282,7 @@ void tst_QThreadPool::destruction()
}
QSemaphore threadRecyclingSemaphore;
-QThread *recycledThread = 0;
+QThread *recycledThread = nullptr;
class ThreadRecorderTask : public QRunnable
{
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp
index e5cfb0fbad..1e01c5a484 100644
--- a/tests/auto/corelib/tools/collections/tst_collections.cpp
+++ b/tests/auto/corelib/tools/collections/tst_collections.cpp
@@ -812,7 +812,7 @@ void tst_Collections::vector()
QVERIFY(LargeStatic::count == originalLargeStaticCount);
{
QVector<LargeStatic> vector;
- LargeStatic *dummy = 0;
+ LargeStatic *dummy = nullptr;
for (int i = 0; i < 10000; ++i) {
delete dummy;
dummy = new LargeStatic;
@@ -834,7 +834,7 @@ void tst_Collections::vector()
QVERIFY(Movable::count == originalMovableCount);
{
QVector<Movable> vector;
- Movable *dummy = 0;
+ Movable *dummy = nullptr;
for (int i = 0; i < 10000; ++i) {
delete dummy;
dummy = new Movable;
@@ -2583,7 +2583,7 @@ void tst_Collections::list_stl()
}
template <typename T>
-T qtInit(T * = 0)
+T qtInit(T * = nullptr)
{
return T();
}
@@ -2593,9 +2593,9 @@ void tst_Collections::q_init()
QCOMPARE(qtInit<int>(), 0);
QCOMPARE(qtInit<double>(), 0.0);
QCOMPARE(qtInit<QString>(), QString());
- QCOMPARE(qtInit<int *>(), static_cast<int *>(0));
- QCOMPARE(qtInit<double *>(), static_cast<double *>(0));
- QCOMPARE(qtInit<QString *>(), static_cast<QString *>(0));
+ QCOMPARE(qtInit<int *>(), static_cast<int *>(nullptr));
+ QCOMPARE(qtInit<double *>(), static_cast<double *>(nullptr));
+ QCOMPARE(qtInit<QString *>(), static_cast<QString *>(nullptr));
QCOMPARE(qtInit<Pod>().i1, 0);
QCOMPARE(qtInit<Pod>().i2, 0);
}
diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
index e0062b9118..76ae592011 100644
--- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
@@ -167,42 +167,42 @@ void tst_QAlgorithms::swap()
}
{
- void *a = 0, *b = 0;
+ void *a = nullptr, *b = nullptr;
qSwap(a, b);
}
{
- const void *a = 0, *b = 0;
+ const void *a = nullptr, *b = nullptr;
qSwap(a, b);
}
{
- QString *a = 0, *b = 0;
+ QString *a = nullptr, *b = nullptr;
qSwap(a, b);
}
{
- const QString *a = 0, *b = 0;
+ const QString *a = nullptr, *b = nullptr;
qSwap(a, b);
}
{
- QString **a = 0, **b = 0;
+ QString **a = nullptr, **b = nullptr;
qSwap(a, b);
}
{
- const QString **a = 0, **b = 0;
+ const QString **a = nullptr, **b = nullptr;
qSwap(a, b);
}
{
- QString * const *a = 0, * const *b = 0;
+ QString * const *a = nullptr, * const *b = nullptr;
qSwap(a, b);
}
{
- const QString * const *a = 0, * const *b = 0;
+ const QString * const *a = nullptr, * const *b = nullptr;
qSwap(a, b);
}
}
diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
index 90fadbb628..069f990e2c 100644
--- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
+++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
@@ -501,7 +501,7 @@ class tst_QEasingProperties : public QObject
Q_OBJECT
Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing)
public:
- tst_QEasingProperties(QObject *parent = 0) : QObject(parent) {}
+ tst_QEasingProperties(QObject *parent = nullptr) : QObject(parent) {}
QEasingCurve easing() const { return e; }
void setEasing(const QEasingCurve& value) { e = value; }
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index 4ca7940556..06c4091232 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -2251,12 +2251,12 @@ void tst_QSharedPointer::invalidConstructs_data()
QTest::newRow("weak-pointer-from-regular-pointer")
<< &QTest::QExternalTest::tryCompileFail
- << "Data *ptr = 0;\n"
+ << "Data *ptr = nullptr;\n"
"QWeakPointer<Data> weakptr(ptr);\n";
QTest::newRow("shared-pointer-implicit-from-uninitialized")
<< &QTest::QExternalTest::tryCompileFail
- << "Data *ptr = 0;\n"
+ << "Data *ptr = nullptr;\n"
"QSharedPointer<Data> weakptr = Qt::Uninitialized;\n";
QTest::newRow("incompatible-custom-deleter1")
diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
index 1ea476e580..3e79fb77f4 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
@@ -46,7 +46,7 @@ class MyServer : public QDBusServer, protected QDBusContext
Q_CLASSINFO("D-Bus Interface", "org.qtproject.autotests.qmyserver")
public:
- MyServer(QObject* parent = 0)
+ MyServer(QObject* parent = nullptr)
: QDBusServer(parent),
m_conn("none"),
obj(NULL)
diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
index e92f173fae..7f098aeb36 100644
--- a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
@@ -39,7 +39,7 @@ class PingerServer : public QDBusServer, protected QDBusContext
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.qtproject.autotests.qpinger")
public:
- PingerServer(QObject* parent = 0)
+ PingerServer(QObject *parent = nullptr)
: QDBusServer(parent),
m_conn("none")
{
diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
index af42224b79..14a7243cf0 100644
--- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
+++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
@@ -39,7 +39,7 @@ class BaseObject: public QObject
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "local.BaseObject")
public:
- BaseObject(QObject *parent = 0) : QObject(parent) { }
+ BaseObject(QObject *parent = nullptr) : QObject(parent) { }
public slots:
void anotherMethod() { }
};
@@ -53,7 +53,7 @@ public slots:
public:
static QString path;
int callCount;
- MyObject(QObject *parent = 0) : BaseObject(parent), callCount(0) {}
+ MyObject(QObject *parent = nullptr) : BaseObject(parent), callCount(0) {}
};
class MyObjectWithoutInterface: public QObject
@@ -66,7 +66,7 @@ public:
static QString path;
static QString interface;
int callCount;
- MyObjectWithoutInterface(QObject *parent = 0) : QObject(parent), callCount(0) {}
+ MyObjectWithoutInterface(QObject *parent = nullptr) : QObject(parent), callCount(0) {}
};
class SignalReceiver : public QObject
@@ -238,7 +238,7 @@ class TestObject : public QObject
{
Q_OBJECT
public:
- TestObject(QObject *parent = 0) : QObject(parent) {}
+ TestObject(QObject *parent = nullptr) : QObject(parent) {}
~TestObject() {}
QString func;
diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
index 535d2f756b..53eb9585f8 100644
--- a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
@@ -44,7 +44,7 @@ class MyServer : public QDBusServer, protected QDBusContext
Q_CLASSINFO("D-Bus Interface", "org.qtproject.autotests.qmyserver")
public:
- MyServer(QObject* parent = 0)
+ MyServer(QObject *parent = nullptr)
: QDBusServer(parent),
m_conn("none")
{
diff --git a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index b55cc2b007..18d4b4cff6 100644
--- a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -3305,7 +3305,7 @@ class tst_QMatrixNxN4x4Properties : public QObject
Q_OBJECT
Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix)
public:
- tst_QMatrixNxN4x4Properties(QObject *parent = 0) : QObject(parent) {}
+ tst_QMatrixNxN4x4Properties(QObject *parent = nullptr) : QObject(parent) {}
QMatrix4x4 matrix() const { return m; }
void setMatrix(const QMatrix4x4& value) { m = value; }
diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
index 3db53be2ab..b4b24548db 100644
--- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -1286,7 +1286,7 @@ class tst_QQuaternionProperties : public QObject
Q_OBJECT
Q_PROPERTY(QQuaternion quaternion READ quaternion WRITE setQuaternion)
public:
- tst_QQuaternionProperties(QObject *parent = 0) : QObject(parent) {}
+ tst_QQuaternionProperties(QObject *parent = nullptr) : QObject(parent) {}
QQuaternion quaternion() const { return q; }
void setQuaternion(const QQuaternion& value) { q = value; }
diff --git a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
index 2085b62cdf..3aa54a4af2 100644
--- a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
+++ b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
@@ -2596,7 +2596,7 @@ class tst_QVectorNDProperties : public QObject
Q_PROPERTY(QVector3D vector3D READ vector3D WRITE setVector3D)
Q_PROPERTY(QVector4D vector4D READ vector4D WRITE setVector4D)
public:
- tst_QVectorNDProperties(QObject *parent = 0) : QObject(parent) {}
+ tst_QVectorNDProperties(QObject *parent = nullptr) : QObject(parent) {}
QVector2D vector2D() const { return v2; }
void setVector2D(const QVector2D& value) { v2 = value; }
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 7b64e3dddb..6b58994daf 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -2697,7 +2697,7 @@ void tst_QPainter::drawhelper_blend_color()
class ViewportTestWidget : public QWidget
{
public:
- ViewportTestWidget(QWidget *parent = 0) : QWidget(parent), hasPainted(false) {}
+ ViewportTestWidget(QWidget *parent = nullptr) : QWidget(parent), hasPainted(false) {}
QSize sizeHint() const override
{
return QSize(100, 100);
diff --git a/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp b/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp
index e915fd7e24..514890d50b 100644
--- a/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp
+++ b/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp
@@ -38,7 +38,7 @@ class InsertCommand : public QUndoCommand
{
public:
InsertCommand(QString *str, int idx, const QString &text,
- QUndoCommand *parent = 0);
+ QUndoCommand *parent = nullptr);
virtual void undo() override;
virtual void redo() override;
@@ -52,7 +52,7 @@ private:
class RemoveCommand : public QUndoCommand
{
public:
- RemoveCommand(QString *str, int idx, int len, QUndoCommand *parent = 0);
+ RemoveCommand(QString *str, int idx, int len, QUndoCommand *parent = nullptr);
virtual void undo() override;
virtual void redo() override;
@@ -66,7 +66,7 @@ private:
class AppendCommand : public QUndoCommand
{
public:
- AppendCommand(QString *str, const QString &text, QUndoCommand *parent = 0);
+ AppendCommand(QString *str, const QString &text, QUndoCommand *parent = nullptr);
virtual void undo() override;
virtual void redo() override;
diff --git a/tests/auto/gui/util/qundostack/tst_qundostack.cpp b/tests/auto/gui/util/qundostack/tst_qundostack.cpp
index 4c201ba4f9..aa3f3c6aa4 100644
--- a/tests/auto/gui/util/qundostack/tst_qundostack.cpp
+++ b/tests/auto/gui/util/qundostack/tst_qundostack.cpp
@@ -39,7 +39,7 @@ class InsertCommand : public QUndoCommand
{
public:
InsertCommand(QString *str, int idx, const QString &text,
- QUndoCommand *parent = 0);
+ QUndoCommand *parent = nullptr);
virtual void undo() override;
virtual void redo() override;
@@ -53,7 +53,7 @@ private:
class RemoveCommand : public QUndoCommand
{
public:
- RemoveCommand(QString *str, int idx, int len, QUndoCommand *parent = 0);
+ RemoveCommand(QString *str, int idx, int len, QUndoCommand *parent = nullptr);
virtual void undo() override;
virtual void redo() override;
@@ -68,7 +68,7 @@ class AppendCommand : public QUndoCommand
{
public:
AppendCommand(QString *str, const QString &text, bool _fail_merge = false,
- QUndoCommand *parent = 0);
+ QUndoCommand *parent = nullptr);
~AppendCommand();
virtual void undo() override;
@@ -88,7 +88,7 @@ private:
class IdleCommand : public QUndoCommand
{
public:
- IdleCommand(QUndoCommand *parent = 0);
+ IdleCommand(QUndoCommand *parent = nullptr);
~IdleCommand();
virtual void undo() override;
@@ -98,7 +98,7 @@ public:
class MoveMouseCommand : public QUndoCommand
{
public:
- MoveMouseCommand(QPoint *mouse, QPoint oldPoint, QPoint newPoint, QUndoCommand *parent = 0);
+ MoveMouseCommand(QPoint *mouse, QPoint oldPoint, QPoint newPoint, QUndoCommand *parent = nullptr);
~MoveMouseCommand();
virtual void undo() override;
@@ -2636,8 +2636,8 @@ void tst_QUndoStack::obsolete()
QSignalSpy redoTextChangedSpy(&stack, &QUndoStack::redoTextChanged);
QPoint mouse(0, 0);
QString str;
- MoveMouseCommand *cmd1 = 0;
- MoveMouseCommand *cmd2 = 0;
+ MoveMouseCommand *cmd1 = nullptr;
+ MoveMouseCommand *cmd2 = nullptr;
stack.resetClean();
checkState(redoTextChangedSpy,
diff --git a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index 4b392d867c..84a9787493 100644
--- a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -77,7 +77,7 @@ class NetworkDiskCache : public QNetworkDiskCache
{
Q_OBJECT
public:
- NetworkDiskCache(QObject *parent = 0)
+ NetworkDiskCache(QObject *parent = nullptr)
: QNetworkDiskCache(parent)
, tempDir(QDir::tempPath() + QLatin1String("/tst_qabstractnetworkcache.XXXXXX"))
, gotData(false)
diff --git a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
index 00afdd8177..2204e9f2f4 100644
--- a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
+++ b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
@@ -734,7 +734,7 @@ void tst_QHttpNetworkConnection::getMultipleWithPipeliningAndMultiplePriorities(
QList<QHttpNetworkReply*> replies;
for (int i = 0; i < requestCount; i++) {
- QHttpNetworkRequest *request = 0;
+ QHttpNetworkRequest *request = nullptr;
if (i % 3)
request = new QHttpNetworkRequest("http://" + httpServerName() + "/qtest/rfc3252.txt", QHttpNetworkRequest::Get);
else
@@ -812,7 +812,7 @@ void tst_QHttpNetworkConnection::getMultipleWithPriorities()
QList<QHttpNetworkReply*> replies;
for (int i = 0; i < requestCount; i++) {
- QHttpNetworkRequest *request = 0;
+ QHttpNetworkRequest *request = nullptr;
if (i % 3)
request = new QHttpNetworkRequest(url, QHttpNetworkRequest::Get);
else
@@ -867,7 +867,7 @@ void tst_QHttpNetworkConnection::getEmptyWithPipelining()
QList<QHttpNetworkReply*> replies;
for (int i = 0; i < requestCount; i++) {
- QHttpNetworkRequest *request = 0;
+ QHttpNetworkRequest *request = nullptr;
request = new QHttpNetworkRequest(url, QHttpNetworkRequest::Get);
request->setPipeliningAllowed(true);
@@ -914,7 +914,7 @@ void tst_QHttpNetworkConnection::getAndEverythingShouldBePipelined()
GetAndEverythingShouldBePipelinedReceiver receiver(requestCount);
for (int i = 0; i < requestCount; i++) {
- QHttpNetworkRequest *request = 0;
+ QHttpNetworkRequest *request = nullptr;
request = new QHttpNetworkRequest(url, QHttpNetworkRequest::Get);
request->setPipeliningAllowed(true);
requests.append(request);
diff --git a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
index 50f118a89f..cb94900660 100644
--- a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
+++ b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
@@ -129,7 +129,7 @@ public slots:
if (doClose) {
client->disconnectFromHost();
disconnect(client, 0, this, 0);
- client = 0;
+ client = nullptr;
}
}
}
@@ -155,7 +155,7 @@ public:
{
setCacheDirectory(path);
- QIODevice *d = 0;
+ QIODevice *d = nullptr;
if (metaData.isValid()) {
d = prepare(metaData);
} else {
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 365de831ab..08e9dd581d 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -939,10 +939,10 @@ class SocketPair: public QObject
public:
QIODevice *endPoints[2];
- SocketPair(QObject *parent = 0)
+ SocketPair(QObject *parent = nullptr)
: QObject(parent)
{
- endPoints[0] = endPoints[1] = 0;
+ endPoints[0] = endPoints[1] = nullptr;
}
bool create()
@@ -976,7 +976,7 @@ class BlockingTcpServer : public QTcpServer
{
Q_OBJECT
public:
- BlockingTcpServer(bool ssl) : doSsl(ssl), sslSocket(0) {}
+ BlockingTcpServer(bool ssl) : doSsl(ssl), sslSocket(nullptr) {}
QTcpSocket* waitForNextConnectionSocket()
{
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index e172c255a7..fee44601cf 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -168,7 +168,7 @@ class LocalSocket : public QLocalSocket
Q_OBJECT
public:
- LocalSocket(QObject *parent = 0) : QLocalSocket(parent)
+ LocalSocket(QObject *parent = nullptr) : QLocalSocket(parent)
{
connect(this, SIGNAL(connected()),
this, SLOT(slotConnected()));
@@ -935,7 +935,7 @@ void tst_QLocalSocket::processConnection_data()
class ProcessOutputDumper
{
public:
- ProcessOutputDumper(QProcess *p = 0)
+ ProcessOutputDumper(QProcess *p = nullptr)
: process(p)
{}
@@ -947,7 +947,7 @@ public:
void clear()
{
- process = 0;
+ process = nullptr;
}
private:
diff --git a/tests/auto/network/socket/qtcpsocket/stressTest/Test.h b/tests/auto/network/socket/qtcpsocket/stressTest/Test.h
index 3e61456f75..5e6b2b9467 100644
--- a/tests/auto/network/socket/qtcpsocket/stressTest/Test.h
+++ b/tests/auto/network/socket/qtcpsocket/stressTest/Test.h
@@ -53,7 +53,7 @@ class My4Server : public QTcpServer
{
Q_OBJECT
public:
- My4Server(QObject *parent = 0);
+ My4Server(QObject *parent = nullptr);
protected:
void incomingConnection(qintptr socket) override;
diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
index b9108932f7..00fcf4afa4 100644
--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
@@ -271,7 +271,7 @@ class SocketPair: public QObject
public:
QTcpSocket *endPoints[2];
- SocketPair(QObject *parent = 0)
+ SocketPair(QObject *parent = nullptr)
: QObject(parent)
{
endPoints[0] = endPoints[1] = 0;
@@ -2163,7 +2163,7 @@ public:
bool networkTimeout;
int count;
- inline Foo(QObject *parent = 0) : QObject(parent)
+ inline Foo(QObject *parent = nullptr) : QObject(parent)
{
attemptedToConnect = false;
networkTimeout = false;
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index e968f5b0f1..e6fea87011 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -3566,7 +3566,7 @@ public:
QByteArray m_identity;
QByteArray m_psk;
- explicit PskProvider(QObject *parent = 0)
+ explicit PskProvider(QObject *parent = nullptr)
: QObject(parent), m_server(false)
{
}
diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp
index fe95120656..1dfd1f977b 100644
--- a/tests/auto/other/gestures/tst_gestures.cpp
+++ b/tests/auto/other/gestures/tst_gestures.cpp
@@ -54,7 +54,7 @@ class CustomGesture : public QGesture
public:
static Qt::GestureType GestureType;
- CustomGesture(QObject *parent = 0)
+ CustomGesture(QObject *parent = nullptr)
: QGesture(parent), serial(0)
{
}
@@ -183,7 +183,7 @@ class GestureWidget : public QWidget
{
Q_OBJECT
public:
- GestureWidget(const char *name = 0, QWidget *parent = 0)
+ GestureWidget(const char *name = nullptr, QWidget *parent = nullptr)
: QWidget(parent)
{
if (name)
@@ -1395,7 +1395,7 @@ void tst_Gestures::ungrabGesture() // a method on QWidget
{
class MockGestureWidget : public GestureWidget {
public:
- MockGestureWidget(const char *name = 0, QWidget *parent = 0)
+ MockGestureWidget(const char *name = nullptr, QWidget *parent = nullptr)
: GestureWidget(name, parent) { }
@@ -1924,7 +1924,7 @@ void tst_Gestures::deleteGestureTargetItem()
class GraphicsView : public QGraphicsView
{
public:
- GraphicsView(QGraphicsScene *scene, QWidget *parent = 0)
+ GraphicsView(QGraphicsScene *scene, QWidget *parent = nullptr)
: QGraphicsView(scene, parent)
{
}
@@ -2124,7 +2124,7 @@ private:
class ReuseCanceledGesturesWidget : public QGraphicsWidget
{
public:
- ReuseCanceledGesturesWidget(Qt::GestureType gestureType = Qt::TapGesture, QGraphicsItem *parent = 0)
+ ReuseCanceledGesturesWidget(Qt::GestureType gestureType = Qt::TapGesture, QGraphicsItem *parent = nullptr)
: QGraphicsWidget(parent),
m_gestureType(gestureType),
m_started(0), m_updated(0), m_canceled(0), m_finished(0)
diff --git a/tests/auto/other/macgui/guitest.h b/tests/auto/other/macgui/guitest.h
index e2bbcf5900..74f4292a6b 100644
--- a/tests/auto/other/macgui/guitest.h
+++ b/tests/auto/other/macgui/guitest.h
@@ -82,7 +82,7 @@ namespace NativeEvents {
class ColorWidget : public QWidget
{
public:
- ColorWidget(QWidget *parent = 0, QColor color = QColor(Qt::red))
+ ColorWidget(QWidget *parent = nullptr, QColor color = QColor(Qt::red))
: QWidget(parent), color(color) {}
QColor color;
diff --git a/tests/auto/other/macnativeevents/nativeeventlist.h b/tests/auto/other/macnativeevents/nativeeventlist.h
index 8f823becf3..7425414da7 100644
--- a/tests/auto/other/macnativeevents/nativeeventlist.h
+++ b/tests/auto/other/macnativeevents/nativeeventlist.h
@@ -43,7 +43,7 @@ class NativeEventList : public QObject
~NativeEventList();
void append(QNativeEvent *event);
- void append(int waitMs, QNativeEvent *event = 0);
+ void append(int waitMs, QNativeEvent *event = nullptr);
void play(Playback playback = WaitUntilFinished);
void stop();
diff --git a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h
index e28575e50b..ba566cbbac 100644
--- a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h
+++ b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h
@@ -39,7 +39,7 @@ class DynamicTreeModel : public QAbstractItemModel
Q_OBJECT
public:
- DynamicTreeModel(QObject *parent = 0);
+ DynamicTreeModel(QObject *parent = nullptr);
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &index) const override;
@@ -86,7 +86,7 @@ class ModelChangeCommand : public QObject
Q_OBJECT
public:
- ModelChangeCommand(DynamicTreeModel *model, QObject *parent = 0);
+ ModelChangeCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelChangeCommand()
{
@@ -132,7 +132,7 @@ class ModelInsertCommand : public ModelChangeCommand
public:
- ModelInsertCommand(DynamicTreeModel *model, QObject *parent = 0);
+ ModelInsertCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelInsertCommand()
{
}
@@ -179,7 +179,7 @@ class ModelResetCommand : public ModelMoveCommand
{
Q_OBJECT
public:
- ModelResetCommand(DynamicTreeModel *model, QObject *parent = 0);
+ ModelResetCommand(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelResetCommand();
@@ -195,7 +195,7 @@ class ModelResetCommandFixed : public ModelMoveCommand
{
Q_OBJECT
public:
- ModelResetCommandFixed(DynamicTreeModel *model, QObject *parent = 0);
+ ModelResetCommandFixed(DynamicTreeModel *model, QObject *parent = nullptr);
virtual ~ModelResetCommandFixed();
diff --git a/tests/auto/other/qaccessibility/accessiblewidgets.h b/tests/auto/other/qaccessibility/accessiblewidgets.h
index d436f81d17..13ca687dd9 100644
--- a/tests/auto/other/qaccessibility/accessiblewidgets.h
+++ b/tests/auto/other/qaccessibility/accessiblewidgets.h
@@ -74,7 +74,7 @@ class KFooButton: public QPushButton
{
Q_OBJECT
public:
- KFooButton(const QString &text, QWidget* parent = 0)
+ KFooButton(const QString &text, QWidget *parent = nullptr)
: QPushButton(text, parent)
{}
};
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index 5c025c8c4e..b9777c6114 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -46,7 +46,7 @@ QT_FORWARD_DECLARE_CLASS(QWidget)
class FocusLineEdit : public QLineEdit
{
public:
- FocusLineEdit( QWidget* parent = 0, const char* name = 0 ) : QLineEdit(name, parent) {}
+ FocusLineEdit(QWidget *parent = nullptr, const char *name = nullptr ) : QLineEdit(name, parent) {}
int focusInEventReason;
int focusOutEventReason;
bool focusInEventRecieved;
@@ -107,7 +107,7 @@ void tst_QFocusEvent::initTestCase()
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
QSKIP("QWindow::requestActivate() is not supported on this platform.");
- testFocusWidget = new QWidget( 0 );
+ testFocusWidget = new QWidget( nullptr );
childFocusWidgetOne = new FocusLineEdit( testFocusWidget );
childFocusWidgetOne->setGeometry( 10, 10, 180, 20 );
childFocusWidgetTwo = new FocusLineEdit( testFocusWidget );
@@ -322,8 +322,8 @@ void tst_QFocusEvent::checkReason_focusWidget()
QTRY_VERIFY(edit1.hasFocus());
edit2.setFocus();
- QVERIFY(frame1.focusWidget() != 0);
- QVERIFY(frame2.focusWidget() != 0);
+ QVERIFY(frame1.focusWidget() != nullptr);
+ QVERIFY(frame2.focusWidget() != nullptr);
}
void tst_QFocusEvent::checkReason_ActiveWindow()
diff --git a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
index 3f18bad5cf..ed365dfcdc 100644
--- a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
+++ b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
@@ -54,7 +54,7 @@ class DownloadCheckWidget : public QWidget
{
Q_OBJECT
public:
- DownloadCheckWidget(QWidget *parent = 0) :
+ DownloadCheckWidget(QWidget *parent = nullptr) :
QWidget(parent), lateReadyRead(true), zeroCopy(false),
progressDlg(this), netmanager(this)
{
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index fc65df108a..9629bb5c7f 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -232,7 +232,7 @@ void tst_QPrinter::testPageRectAndPaperRect()
QFETCH(int, resolution);
QFETCH(bool, doPaperRect);
- QPainter *painter = 0;
+ QPainter *painter = nullptr;
printer->setPageOrientation(orientation);
printer->setOutputFileName(testFileName(QLatin1String("silly"), QString()));
@@ -246,7 +246,7 @@ void tst_QPrinter::testPageRectAndPaperRect()
QRect otherRect = (doPaperRect ? printer->paperRect(QPrinter::DevicePixel) : printer->pageRect(QPrinter::DevicePixel)).toRect();
float otherInchesX = float(otherRect.width()) / float(printer->resolution());
float otherInchesY = float(otherRect.height()) / float(printer->resolution());
- if (painter != 0)
+ if (painter != nullptr)
delete painter;
QVERIFY(qAbs(otherInchesX - inchesX) < 0.01);
@@ -282,7 +282,7 @@ void tst_QPrinter::testMargins()
QFETCH(QPageLayout::Orientation, orientation);
QFETCH(QPageSize::PageSizeId, pagesize);
QFETCH(bool, fullpage);
- QPainter *painter = 0;
+ QPainter *painter = nullptr;
printer->setOutputFileName(testFileName(QLatin1String("silly"), QString()));
printer->setPageOrientation(orientation);
printer->setFullPage(fullpage);
diff --git a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
index 6d1062d881..a8a0a453e2 100644
--- a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
+++ b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
@@ -93,7 +93,7 @@ class QtTestSqlThread : public QThread
{
Q_OBJECT
public:
- QtTestSqlThread(const QSqlDatabase &aDb, QObject *parent = 0)
+ QtTestSqlThread(const QSqlDatabase &aDb, QObject *parent = nullptr)
: QThread(parent), sourceDb(aDb) {}
void runHelper(const QString &dbName)
@@ -129,7 +129,7 @@ class SqlProducer: public QThread
{
Q_OBJECT
public:
- SqlProducer(const QSqlDatabase &aDb, QObject *parent = 0)
+ SqlProducer(const QSqlDatabase &aDb, QObject *parent = nullptr)
: QThread(parent), sourceDb(aDb) {}
void runHelper(const QString &dbName)
@@ -164,7 +164,7 @@ class SqlConsumer: public QThread
Q_OBJECT
public:
- SqlConsumer(const QSqlDatabase &aDb, QObject *parent = 0)
+ SqlConsumer(const QSqlDatabase &aDb, QObject *parent = nullptr)
: QThread(parent), sourceDb(aDb) {}
void runHelper(const QString &dbName)
@@ -203,7 +203,7 @@ class SqlThread: public QThread
public:
enum Mode { SimpleReading, PreparedReading, SimpleWriting, PreparedWriting };
- SqlThread(Mode m, const QSqlDatabase &db, QObject *parent = 0)
+ SqlThread(Mode m, const QSqlDatabase &db, QObject *parent = nullptr)
: QThread(parent), sourceDb(db), mode(m) {}
void run() override
diff --git a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
index 88e052cd18..343bd88338 100644
--- a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
+++ b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
@@ -97,7 +97,7 @@ private:
class DBTestModel: public QSqlQueryModel
{
public:
- DBTestModel(QObject *parent = 0): QSqlQueryModel(parent) {}
+ DBTestModel(QObject *parent = nullptr): QSqlQueryModel(parent) {}
QModelIndex indexInQuery(const QModelIndex &item) const { return QSqlQueryModel::indexInQuery(item); }
};
@@ -582,7 +582,7 @@ class NestedResetsTest: public QSqlQueryModel
Q_OBJECT
public:
- NestedResetsTest(QObject* parent = 0) : QSqlQueryModel(parent), gotAboutToBeReset(false), gotReset(false)
+ NestedResetsTest(QObject *parent = nullptr) : QSqlQueryModel(parent), gotAboutToBeReset(false), gotReset(false)
{
connect(this, SIGNAL(modelAboutToBeReset()), this, SLOT(modelAboutToBeResetSlot()));
connect(this, SIGNAL(modelReset()), this, SLOT(modelResetSlot()));
diff --git a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
index b305eee0ec..0aff8f8c1b 100644
--- a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
+++ b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
@@ -143,7 +143,7 @@ class AccessibleProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
- AccessibleProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent)
+ AccessibleProxyModel(QObject *parent = nullptr) : QSortFilterProxyModel(parent)
{
}
@@ -157,7 +157,7 @@ class ObservingObject : public QObject
{
Q_OBJECT
public:
- ObservingObject(AccessibleProxyModel *proxy, QObject *parent = 0) :
+ ObservingObject(AccessibleProxyModel *proxy, QObject *parent = nullptr) :
QObject(parent),
m_proxy(proxy),
storePersistentFailureCount(0),
diff --git a/tests/auto/tools/moc/cxx11-explicit-override-control.h b/tests/auto/tools/moc/cxx11-explicit-override-control.h
index 2211112717..961d7c47c2 100644
--- a/tests/auto/tools/moc/cxx11-explicit-override-control.h
+++ b/tests/auto/tools/moc/cxx11-explicit-override-control.h
@@ -40,7 +40,7 @@ class ExplicitOverrideControlBase : public QObject
{
Q_OBJECT
public:
- explicit ExplicitOverrideControlBase(QObject *parent = 0)
+ explicit ExplicitOverrideControlBase(QObject *parent = nullptr)
: QObject(parent) {}
private Q_SLOTS:
@@ -62,7 +62,7 @@ class ExplicitOverrideControlFinalQt : public ExplicitOverrideControlBase
{
Q_OBJECT
public:
- explicit ExplicitOverrideControlFinalQt(QObject *parent = 0)
+ explicit ExplicitOverrideControlFinalQt(QObject *parent = nullptr)
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
@@ -84,7 +84,7 @@ class ExplicitOverrideControlFinalCxx11 : public ExplicitOverrideControlBase
{
Q_OBJECT
public:
- explicit ExplicitOverrideControlFinalCxx11(QObject *parent = 0)
+ explicit ExplicitOverrideControlFinalCxx11(QObject *parent = nullptr)
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
@@ -106,7 +106,7 @@ class ExplicitOverrideControlSealed : public ExplicitOverrideControlBase
{
Q_OBJECT
public:
- explicit ExplicitOverrideControlSealed(QObject *parent = 0)
+ explicit ExplicitOverrideControlSealed(QObject *parent = nullptr)
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
@@ -128,7 +128,7 @@ class ExplicitOverrideControlOverrideQt : public ExplicitOverrideControlBase
{
Q_OBJECT
public:
- explicit ExplicitOverrideControlOverrideQt(QObject *parent = 0)
+ explicit ExplicitOverrideControlOverrideQt(QObject *parent = nullptr)
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
@@ -150,7 +150,7 @@ class ExplicitOverrideControlOverrideCxx11 : public ExplicitOverrideControlBase
{
Q_OBJECT
public:
- explicit ExplicitOverrideControlOverrideCxx11(QObject *parent = 0)
+ explicit ExplicitOverrideControlOverrideCxx11(QObject *parent = nullptr)
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
@@ -172,7 +172,7 @@ class ExplicitOverrideControlFinalQtOverrideQt : public ExplicitOverrideControlB
{
Q_OBJECT
public:
- explicit ExplicitOverrideControlFinalQtOverrideQt(QObject *parent = 0)
+ explicit ExplicitOverrideControlFinalQtOverrideQt(QObject *parent = nullptr)
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
@@ -194,7 +194,7 @@ class ExplicitOverrideControlFinalCxx11OverrideCxx11 : public ExplicitOverrideCo
{
Q_OBJECT
public:
- explicit ExplicitOverrideControlFinalCxx11OverrideCxx11(QObject *parent = 0)
+ explicit ExplicitOverrideControlFinalCxx11OverrideCxx11(QObject *parent = nullptr)
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
@@ -216,7 +216,7 @@ class ExplicitOverrideControlSealedOverride : public ExplicitOverrideControlBase
{
Q_OBJECT
public:
- explicit ExplicitOverrideControlSealedOverride(QObject *parent = 0)
+ explicit ExplicitOverrideControlSealedOverride(QObject *parent = nullptr)
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
diff --git a/tests/auto/tools/moc/cxx11-final-classes.h b/tests/auto/tools/moc/cxx11-final-classes.h
index 0e1d8a7787..4bb5181eae 100644
--- a/tests/auto/tools/moc/cxx11-final-classes.h
+++ b/tests/auto/tools/moc/cxx11-final-classes.h
@@ -41,7 +41,7 @@ class FinalTestClassQt Q_DECL_FINAL : public QObject
{
Q_OBJECT
public:
- explicit FinalTestClassQt(QObject *parent = 0)
+ explicit FinalTestClassQt(QObject *parent = nullptr)
: QObject(parent) {}
};
@@ -50,7 +50,7 @@ class EXPORT_MACRO ExportedFinalTestClassQt Q_DECL_FINAL : public QObject
{
Q_OBJECT
public:
- explicit ExportedFinalTestClassQt(QObject *parent = 0)
+ explicit ExportedFinalTestClassQt(QObject *parent = nullptr)
: QObject(parent) {}
};
@@ -58,7 +58,7 @@ class EXPORT_MACRO2(X,Y,Z) ExportedFinalTestClassQtX Q_DECL_FINAL : public QObje
{
Q_OBJECT
public:
- explicit ExportedFinalTestClassQtX(QObject *parent = 0)
+ explicit ExportedFinalTestClassQtX(QObject *parent = nullptr)
: QObject(parent) {}
};
@@ -66,7 +66,7 @@ class FinalTestClassCpp11 final : public QObject
{
Q_OBJECT
public:
- explicit FinalTestClassCpp11(QObject *parent = 0)
+ explicit FinalTestClassCpp11(QObject *parent = nullptr)
: QObject(parent) {}
};
@@ -74,7 +74,7 @@ class EXPORT_MACRO ExportedFinalTestClassCpp11 final : public QObject
{
Q_OBJECT
public:
- explicit ExportedFinalTestClassCpp11(QObject *parent = 0)
+ explicit ExportedFinalTestClassCpp11(QObject *parent = nullptr)
: QObject(parent) {}
};
@@ -82,7 +82,7 @@ class EXPORT_MACRO2(X,Y,Z) ExportedFinalTestClassCpp11X final : public QObject
{
Q_OBJECT
public:
- explicit ExportedFinalTestClassCpp11X(QObject *parent = 0)
+ explicit ExportedFinalTestClassCpp11X(QObject *parent = nullptr)
: QObject(parent) {}
};
@@ -90,7 +90,7 @@ class SealedTestClass sealed : public QObject
{
Q_OBJECT
public:
- explicit SealedTestClass(QObject *parent = 0)
+ explicit SealedTestClass(QObject *parent = nullptr)
: QObject(parent) {}
};
@@ -98,7 +98,7 @@ class EXPORT_MACRO ExportedSealedTestClass sealed : public QObject
{
Q_OBJECT
public:
- explicit ExportedSealedTestClass(QObject *parent = 0)
+ explicit ExportedSealedTestClass(QObject *parent = nullptr)
: QObject(parent) {}
};
@@ -106,7 +106,7 @@ class EXPORT_MACRO2(X,Y,Z) ExportedSealedTestClassX sealed : public QObject
{
Q_OBJECT
public:
- explicit ExportedSealedTestClassX(QObject *parent = 0)
+ explicit ExportedSealedTestClassX(QObject *parent = nullptr)
: QObject(parent) {}
};
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 39712c6d22..d3af266e74 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -598,7 +598,7 @@ class CtorTestClass : public QObject
{
Q_OBJECT
public:
- Q_INVOKABLE CtorTestClass(QObject *parent = 0);
+ Q_INVOKABLE CtorTestClass(QObject *parent = nullptr);
CtorTestClass(int foo);
@@ -1562,7 +1562,7 @@ class PrivatePropertyTest : public QObject
int mBaz;
};
public:
- PrivatePropertyTest(QObject *parent = 0) : QObject(parent), mFoo(0), d (new MyDPointer) {}
+ PrivatePropertyTest(QObject *parent = nullptr) : QObject(parent), mFoo(0), d (new MyDPointer) {}
int foo() { return mFoo ; }
void setFoo(int value) { mFoo = value; }
MyDPointer *d_func() {return d.data();}
@@ -2466,7 +2466,7 @@ class SignalConnectionTester : public QObject
{
Q_OBJECT
public:
- SignalConnectionTester(QObject *parent = 0)
+ SignalConnectionTester(QObject *parent = nullptr)
: QObject(parent), testPassed(false)
{
@@ -2494,7 +2494,7 @@ class ClassWithPrivateSignals : public QObject
{
Q_OBJECT
public:
- ClassWithPrivateSignals(QObject *parent = 0)
+ ClassWithPrivateSignals(QObject *parent = nullptr)
: QObject(parent)
{
@@ -2530,7 +2530,7 @@ class SubClassFromPrivateSignals : public ClassWithPrivateSignals
{
Q_OBJECT
public:
- SubClassFromPrivateSignals(QObject *parent = 0)
+ SubClassFromPrivateSignals(QObject *parent = nullptr)
: ClassWithPrivateSignals(parent)
{
@@ -3031,7 +3031,7 @@ public:
One,
Two
};
- explicit CustomQObject(QObject *parent = 0)
+ explicit CustomQObject(QObject *parent = nullptr)
: QObject(parent)
{
}
@@ -3048,7 +3048,7 @@ class NamespacedQObject : public QObject
{
Q_OBJECT
public:
- explicit NamespacedQObject(QObject *parent = 0)
+ explicit NamespacedQObject(QObject *parent = nullptr)
: QObject(parent)
{
@@ -3072,7 +3072,7 @@ public:
One,
Two
};
- explicit CustomQObject2(QObject *parent = 0)
+ explicit CustomQObject2(QObject *parent = nullptr)
: QObject(parent)
{
}
@@ -3089,7 +3089,7 @@ class NamespacedQObject2 : public QObject
{
Q_OBJECT
public:
- explicit NamespacedQObject2(QObject *parent = 0)
+ explicit NamespacedQObject2(QObject *parent = nullptr)
: QObject(parent)
{
@@ -3141,7 +3141,7 @@ class AutoRegistrationObject : public QObject
Q_PROPERTY(SomeNamespace::NamespacedQObject* customObjectNamespaced READ customObjectNamespaced CONSTANT)
Q_PROPERTY(SomeNamespace::NamespacedNonQObject customNonQObjectNamespaced READ customNonQObjectNamespaced CONSTANT)
public:
- AutoRegistrationObject(QObject *parent = 0)
+ AutoRegistrationObject(QObject *parent = nullptr)
: QObject(parent)
{
}
diff --git a/tests/auto/tools/qdbuscpp2xml/test1.h b/tests/auto/tools/qdbuscpp2xml/test1.h
index 337fada86d..69f3a2cadc 100644
--- a/tests/auto/tools/qdbuscpp2xml/test1.h
+++ b/tests/auto/tools/qdbuscpp2xml/test1.h
@@ -54,7 +54,7 @@ public:
#endif
};
- Test1(QObject *parent = 0) : QObject(parent) {}
+ Test1(QObject *parent = nullptr) : QObject(parent) {}
int numProperty1() { return 42; }
diff --git a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
index 413b865f04..c329ca9f3e 100644
--- a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
+++ b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
@@ -58,7 +58,7 @@ class TestNativeDialog : public QColorDialog
public:
QWidget *m_activeModalWidget;
- TestNativeDialog(QWidget *parent = 0)
+ TestNativeDialog(QWidget *parent = nullptr)
: QColorDialog(parent), m_activeModalWidget(0)
{
QTimer::singleShot(1, this, SLOT(test_activeModalWidgetSignal()));
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index 266ed0de05..cc613b8218 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -98,7 +98,7 @@ void tst_QDialog::getSetCheck()
class ToolDialog : public QDialog
{
public:
- ToolDialog(QWidget *parent = 0)
+ ToolDialog(QWidget *parent = nullptr)
: QDialog(parent, Qt::Tool), mWasActive(false), mWasModalWindow(false), tId(-1) {}
bool wasActive() const { return mWasActive; }
diff --git a/tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp b/tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp
index a4204da20e..49ecc7305d 100644
--- a/tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp
+++ b/tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp
@@ -44,7 +44,7 @@ void tst_QErrorMessage::dontShowAgain()
{
QString plainString = QLatin1String("foo");
QString htmlString = QLatin1String("foo<br>bar");
- QCheckBox *checkBox = 0;
+ QCheckBox *checkBox = nullptr;
QErrorMessage errorMessageDialog(0);
@@ -92,7 +92,7 @@ void tst_QErrorMessage::dontShowCategoryAgain()
{
QString htmlString = QLatin1String("foo<br>bar");
QString htmlString2 = QLatin1String("foo2<br>bar2");
- QCheckBox *checkBox = 0;
+ QCheckBox *checkBox = nullptr;
QErrorMessage errorMessageDialog(0);
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 4b9466d3b6..e070f74ae5 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -365,7 +365,7 @@ void tst_QFiledialog::filterSelectedSignal()
void tst_QFiledialog::args()
{
- QWidget *parent = 0;
+ QWidget *parent = nullptr;
QString caption = "caption";
QString directory = QDir::tempPath();
QString filter = "*.mp3";
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index 45ed5d7d21..92ca7f005c 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -918,7 +918,7 @@ void tst_QFileDialog2::task239706_editableFilterCombo()
QVERIFY(QTest::qWaitForWindowExposed(&d));
QList<QComboBox *> comboList = d.findChildren<QComboBox *>();
- QComboBox *filterCombo = 0;
+ QComboBox *filterCombo = nullptr;
foreach (QComboBox *combo, comboList) {
if (combo->objectName() == QString("fileTypeCombo")) {
filterCombo = combo;
@@ -991,7 +991,7 @@ void tst_QFileDialog2::task251321_sideBarHiddenEntries()
class MyQSideBar : public QSidebar
{
public :
- MyQSideBar(QWidget *parent = 0) : QSidebar(parent)
+ MyQSideBar(QWidget *parent = nullptr) : QSidebar(parent)
{}
void removeSelection() {
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index 3e8a81c33c..b8d2a4617c 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -372,11 +372,11 @@ void tst_QWizard::setButton()
QVERIFY(qobject_cast<QCheckBox *>(wizard.button(QWizard::CustomButton2)));
QVERIFY(qobject_cast<QPushButton *>(wizard.button(QWizard::CustomButton1)));
- QVERIFY(toolButton != 0);
+ QVERIFY(toolButton != nullptr);
// resetting the same button does nothing
wizard.setButton(QWizard::NextButton, toolButton);
- QVERIFY(toolButton != 0);
+ QVERIFY(toolButton != nullptr);
// revert to default button
wizard.setButton(QWizard::NextButton, 0);
@@ -470,8 +470,8 @@ public:
}
void registerField(const QString &name, QWidget *widget,
- const char *property = 0,
- const char *changedSignal = 0)
+ const char *property = nullptr,
+ const char *changedSignal = nullptr)
{ QWizardPage::registerField(name, widget, property, changedSignal); }
QLineEdit *edit1;
@@ -2409,7 +2409,7 @@ void tst_QWizard::sideWidget()
{
QWizard wizard;
- wizard.setSideWidget(0);
+ wizard.setSideWidget(nullptr);
QVERIFY(!wizard.sideWidget());
QScopedPointer<QWidget> w1(new QWidget(&wizard));
wizard.setSideWidget(w1.data());
@@ -2417,11 +2417,11 @@ void tst_QWizard::sideWidget()
QWidget *w2 = new QWidget(&wizard);
wizard.setSideWidget(w2);
QCOMPARE(wizard.sideWidget(), w2);
- QVERIFY(w1->parent() != 0);
+ QVERIFY(w1->parent() != nullptr);
QCOMPARE(w1->window(), static_cast<QWidget *>(&wizard));
QCOMPARE(w2->window(), static_cast<QWidget *>(&wizard));
- w1->setParent(0);
- wizard.setSideWidget(0);
+ w1->setParent(nullptr);
+ wizard.setSideWidget(nullptr);
QVERIFY(!wizard.sideWidget());
}
@@ -2498,7 +2498,7 @@ void tst_QWizard::task177716_disableCommitButton()
class WizardPage_task183550 : public QWizardPage
{
public:
- WizardPage_task183550(QWidget *parent = 0)
+ WizardPage_task183550(QWidget *parent = nullptr)
: QWizardPage(parent)
, treeWidget(new QTreeWidget)
, verticalPolicy(QSizePolicy::MinimumExpanding) {}
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard_2.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard_2.cpp
index cc48543a76..e090c0d851 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard_2.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard_2.cpp
@@ -41,7 +41,7 @@ class taskQTBUG_25691 : public QWizard
{
Q_OBJECT
public:
- taskQTBUG_25691( QWidget * parent = 0 );
+ taskQTBUG_25691( QWidget * parent = nullptr );
~taskQTBUG_25691(void);
};
@@ -50,7 +50,7 @@ class taskQTBUG_25691Page1 : public QWizardPage
{
Q_OBJECT
public:
- taskQTBUG_25691Page1( QWidget * parent = 0 );
+ taskQTBUG_25691Page1( QWidget * parent = nullptr );
~taskQTBUG_25691Page1(void);
};
@@ -59,7 +59,7 @@ class taskQTBUG_25691Page2 : public QWizardPage
{
Q_OBJECT
public:
- taskQTBUG_25691Page2( QWidget * parent = 0 );
+ taskQTBUG_25691Page2( QWidget * parent = nullptr );
virtual void initializePage(void) override;
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
index bd1b56ebc1..0aead57d11 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -68,9 +68,9 @@ void tst_QGraphicsEffect::initTestCase()
class CustomItem : public QGraphicsRectItem
{
public:
- CustomItem(qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent = 0)
+ CustomItem(qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent = nullptr)
: QGraphicsRectItem(x, y, width, height, parent), numRepaints(0),
- m_painter(0), m_styleOption(0)
+ m_painter(nullptr), m_styleOption(nullptr)
{}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
@@ -84,8 +84,8 @@ public:
void reset()
{
numRepaints = 0;
- m_painter = 0;
- m_styleOption = 0;
+ m_painter = nullptr;
+ m_styleOption = nullptr;
}
int numRepaints;
@@ -98,7 +98,8 @@ class CustomEffect : public QGraphicsEffect
public:
CustomEffect()
: QGraphicsEffect(), numRepaints(0), m_margin(10),
- doNothingInDraw(false), m_painter(0), m_styleOption(0), m_source(0), m_opacity(1.0)
+ doNothingInDraw(false), m_painter(nullptr), m_styleOption(nullptr),
+ m_source(nullptr), m_opacity(1.0)
{}
QRectF boundingRectFor(const QRectF &rect) const override
@@ -108,9 +109,9 @@ public:
{
numRepaints = 0;
m_sourceChangedFlags = QGraphicsEffect::ChangeFlags();
- m_painter = 0;
- m_styleOption = 0;
- m_source = 0;
+ m_painter = nullptr;
+ m_styleOption = nullptr;
+ m_source = nullptr;
m_opacity = 1.0;
}
@@ -645,7 +646,7 @@ void tst_QGraphicsEffect::dropShadowClipping()
class MyGraphicsItem : public QGraphicsWidget
{
public:
- MyGraphicsItem(QGraphicsItem *parent = 0) :
+ MyGraphicsItem(QGraphicsItem *parent = nullptr) :
QGraphicsWidget(parent), nbPaint(0)
{}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index 934505034e..f755b4eb76 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -85,7 +85,7 @@ private slots:
class RectWidget : public QGraphicsWidget
{
public:
- RectWidget(QGraphicsItem *parent = 0) : QGraphicsWidget(parent){}
+ RectWidget(QGraphicsItem *parent = nullptr) : QGraphicsWidget(parent){}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
{
@@ -1112,8 +1112,8 @@ public:
vspacing = 10;
}
- virtual int pixelMetric(PixelMetric metric, const QStyleOption * option = 0,
- const QWidget * widget = 0 ) const override;
+ virtual int pixelMetric(PixelMetric metric, const QStyleOption * option = nullptr,
+ const QWidget * widget = nullptr) const override;
int hspacing;
int vspacing;
@@ -1121,8 +1121,8 @@ public:
int layoutSpacing(QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2,
Qt::Orientation orientation,
- const QStyleOption *option = 0,
- const QWidget *widget = 0) const override;
+ const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const override;
};
@@ -1132,8 +1132,8 @@ public:
int CustomLayoutStyle::layoutSpacing(QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2,
Qt::Orientation orientation,
- const QStyleOption * /*option = 0*/,
- const QWidget * /*widget = 0*/) const
+ const QStyleOption * /*option = nullptr*/,
+ const QWidget * /*widget = nullptr*/) const
{
if (orientation == Qt::Horizontal) {
switch (CT2(control1, control2)) {
@@ -1153,8 +1153,8 @@ int CustomLayoutStyle::layoutSpacing(QSizePolicy::ControlType control1,
}
}
-int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * option /*= 0*/,
- const QWidget * widget /*= 0*/ ) const
+int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * option /*= nullptr*/,
+ const QWidget * widget /*= nullptr*/ ) const
{
switch (metric) {
case PM_LayoutLeftMargin:
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index d1f8954ab9..840db1c364 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -149,7 +149,7 @@ Q_DECLARE_METATYPE(AnchorItemSizeHintList)
class TestWidget : public QGraphicsWidget
{
public:
- inline TestWidget(QGraphicsItem *parent = 0, const QString &name = QString())
+ inline TestWidget(QGraphicsItem *parent = nullptr, const QString &name = QString())
: QGraphicsWidget(parent)
{
setContentsMargins( 0,0,0,0 );
diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index 7e7536a94c..986ef2a126 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -119,7 +119,7 @@ private slots:
class RectWidget : public QGraphicsWidget
{
public:
- RectWidget(QGraphicsItem *parent = 0) : QGraphicsWidget(parent), m_fnConstraint(0) {}
+ RectWidget(QGraphicsItem *parent = nullptr) : QGraphicsWidget(parent), m_fnConstraint(0) {}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
{
diff --git a/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
index cc416f76b2..7143dec0a1 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
@@ -90,7 +90,7 @@ enum FunctionType {
class TestGraphicsWidget : public QGraphicsWidget {
public:
- TestGraphicsWidget(QGraphicsWidget *parent = 0) : QGraphicsWidget(parent)
+ TestGraphicsWidget(QGraphicsWidget *parent = nullptr) : QGraphicsWidget(parent)
{ }
bool event(QEvent *e) override
@@ -229,7 +229,7 @@ void tst_QGraphicsLayout::automaticReparenting()
class TestLayout : public QGraphicsLinearLayout
{
public:
- TestLayout(QGraphicsLayoutItem *parent = 0)
+ TestLayout(QGraphicsLayoutItem *parent = nullptr)
: QGraphicsLinearLayout(parent)
{
setContentsMargins(0,0,0,0);
diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index 0851b20927..4371347475 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -143,7 +143,7 @@ void tst_QGraphicsLinearLayout::initTestCase()
class RectWidget : public QGraphicsWidget
{
public:
- RectWidget(QGraphicsItem *parent = 0, const QBrush &brush = QBrush()) : QGraphicsWidget(parent){ m_brush = brush;}
+ RectWidget(QGraphicsItem *parent = nullptr, const QBrush &brush = QBrush()) : QGraphicsWidget(parent){ m_brush = brush;}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
{
@@ -514,7 +514,7 @@ void tst_QGraphicsLinearLayout::insertItem()
for (int i = 0; i < layoutCount; ++i)
layout.addItem(new SubQGraphicsLinearLayout);
- QGraphicsLayoutItem *item = 0;
+ QGraphicsLayoutItem *item = nullptr;
if (isWidget)
item = new QGraphicsWidget;
else
@@ -571,7 +571,7 @@ void tst_QGraphicsLinearLayout::insertStretch()
scene.addItem(widget);
QList<QGraphicsWidget *>items;
- QGraphicsWidget *item = 0;
+ QGraphicsWidget *item = nullptr;
for (int i = 0; i < itemCount; ++i) {
item = new RectWidget;
item->setMinimumSize(10, 10);
@@ -792,7 +792,7 @@ void tst_QGraphicsLinearLayout::removeAt()
layout.addItem(new SubQGraphicsLinearLayout);
QSizeF oldSizeHint = layout.sizeHint(Qt::PreferredSize, QSizeF());
- QGraphicsLayoutItem *w = 0;
+ QGraphicsLayoutItem *w = nullptr;
if (removeItemAt >= 0 && removeItemAt < layout.count())
w = layout.itemAt(removeItemAt);
if (w) {
@@ -842,7 +842,7 @@ void tst_QGraphicsLinearLayout::removeItem()
for (int i = 0; i < layoutCount; ++i)
layout.addItem(new SubQGraphicsLinearLayout);
- QGraphicsLayoutItem *w = 0;
+ QGraphicsLayoutItem *w = nullptr;
if (removeItemAt >= 0 && removeItemAt < layout.count())
w = layout.itemAt(removeItemAt);
QSizeF oldSizeHint = layout.sizeHint(Qt::PreferredSize, QSizeF());
diff --git a/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp b/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
index ddcdc809d9..482ce7d244 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
@@ -210,7 +210,7 @@ void tst_QGraphicsObject::visible()
class DeleteTester : public QGraphicsObject
{
public:
- DeleteTester(bool *w, bool *pw, QGraphicsItem *parent = 0)
+ DeleteTester(bool *w, bool *pw, QGraphicsItem *parent = nullptr)
: QGraphicsObject(parent), wasDeleted(w), parentWasDeleted(pw)
{ }
@@ -223,7 +223,7 @@ public:
}
}
- void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0) override
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr) override
{ }
QRectF boundingRect() const override
{ return QRectF(); }
diff --git a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp
index e7bba010d9..a8f5e396e8 100644
--- a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp
@@ -74,11 +74,11 @@ public:
enum Extension {
UserExtension = QGraphicsItem::UserExtension
};
- SubQGraphicsPixmapItem(QGraphicsItem *parent = 0) : QGraphicsPixmapItem(parent)
+ SubQGraphicsPixmapItem(QGraphicsItem *parent = nullptr) : QGraphicsPixmapItem(parent)
{
}
- SubQGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = 0) : QGraphicsPixmapItem(pixmap, parent)
+ SubQGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = nullptr) : QGraphicsPixmapItem(pixmap, parent)
{
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp
index 5380dd0daf..9f0d47223b 100644
--- a/tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp
@@ -70,11 +70,11 @@ public:
UserExtension = QGraphicsItem::UserExtension
};
- SubQGraphicsPolygonItem(QGraphicsItem *parent = 0) : QGraphicsPolygonItem(parent)
+ SubQGraphicsPolygonItem(QGraphicsItem *parent = nullptr) : QGraphicsPolygonItem(parent)
{
}
- SubQGraphicsPolygonItem(const QPolygonF &polygon, QGraphicsItem *parent = 0) : QGraphicsPolygonItem(polygon, parent)
+ SubQGraphicsPolygonItem(const QPolygonF &polygon, QGraphicsItem *parent = nullptr) : QGraphicsPolygonItem(polygon, parent)
{
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 34f27dbfcf..7cb441a925 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -170,7 +170,7 @@ class SubQGraphicsProxyWidget : public QGraphicsProxyWidget
{
public:
- SubQGraphicsProxyWidget(QGraphicsItem *parent = 0) : QGraphicsProxyWidget(parent),
+ SubQGraphicsProxyWidget(QGraphicsItem *parent = nullptr) : QGraphicsProxyWidget(parent),
paintCount(0), keyPress(0), focusOut(0)
{}
@@ -225,7 +225,7 @@ public:
void call_showEvent(QShowEvent* event)
{ return SubQGraphicsProxyWidget::showEvent(event); }
- void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) {
+ void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) {
paintCount++;
QGraphicsProxyWidget::paint(painter, option, widget);
}
@@ -1482,7 +1482,7 @@ void tst_QGraphicsProxyWidget::maximumSize()
class View : public QGraphicsView
{
public:
- View(QGraphicsScene *scene, QWidget *parent = 0)
+ View(QGraphicsScene *scene, QWidget *parent = nullptr)
: QGraphicsView(scene, parent), npaints(0)
{ }
QRegion paintEventRegion;
@@ -2758,7 +2758,7 @@ void tst_QGraphicsProxyWidget::childPos()
QApplication::processEvents();
QApplication::processEvents();
- QWidget *menu = 0;
+ QWidget *menu = nullptr;
foreach (QObject *child, box->children()) {
if ((menu = qobject_cast<QWidget *>(child)))
break;
@@ -3670,7 +3670,7 @@ void tst_QGraphicsProxyWidget::windowFrameMargins()
class HoverButton : public QPushButton
{
public:
- HoverButton(QWidget *parent = 0) : QPushButton(parent), hoverLeaveReceived(false)
+ HoverButton(QWidget *parent = nullptr) : QPushButton(parent), hoverLeaveReceived(false)
{}
bool hoverLeaveReceived;
@@ -3830,7 +3830,7 @@ void tst_QGraphicsProxyWidget::QTBUG_43780_visibility()
class TouchWidget : public QWidget
{
public:
- TouchWidget(QWidget *parent = 0) : QWidget(parent) {}
+ TouchWidget(QWidget *parent = nullptr) : QWidget(parent) {}
bool event(QEvent *event)
{
diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
index d875eb1db4..640e0418e5 100644
--- a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
@@ -73,7 +73,7 @@ void tst_QGraphicsSceneIndex::common_data()
QGraphicsSceneIndex *tst_QGraphicsSceneIndex::createIndex(const QString &indexMethod)
{
- QGraphicsSceneIndex *index = 0;
+ QGraphicsSceneIndex *index = nullptr;
QGraphicsScene *scene = new QGraphicsScene();
if (indexMethod == "bsp")
index = new QGraphicsSceneBspTreeIndex(scene);
@@ -277,7 +277,7 @@ class RectWidget : public QGraphicsWidget
{
Q_OBJECT
public:
- RectWidget(QGraphicsItem *parent = 0) : QGraphicsWidget(parent)
+ RectWidget(QGraphicsItem *parent = nullptr) : QGraphicsWidget(parent)
{
}
@@ -333,7 +333,7 @@ void tst_QGraphicsSceneIndex::clear()
class MyItem : public QGraphicsItem
{
public:
- MyItem(QGraphicsItem *parent = 0) : QGraphicsItem(parent), numPaints(0) {}
+ MyItem(QGraphicsItem *parent = nullptr) : QGraphicsItem(parent), numPaints(0) {}
int numPaints;
protected:
QRectF boundingRect() const override { return QRectF(0, 0, 10, 10); }
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 42a16dc1f4..41d29e9b7b 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -1593,7 +1593,7 @@ public:
: QGraphicsRectItem(rect), numPaints(0)
{ }
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override
{
++numPaints;
QGraphicsRectItem::paint(painter, option, widget);
@@ -2422,7 +2422,7 @@ class CustomView : public QGraphicsView
{
Q_OBJECT
public:
- CustomView(QGraphicsScene *s = 0) : QGraphicsView(s) {}
+ CustomView(QGraphicsScene *s = nullptr) : QGraphicsView(s) {}
CustomView(QGraphicsScene *s, QWidget *parent)
: QGraphicsView(s, parent) {}
QList<QRegion> lastUpdateRegions;
@@ -3152,7 +3152,7 @@ void tst_QGraphicsView::itemsUnderMouse()
class QGraphicsTextItem_task172231 : public QGraphicsTextItem
{
public:
- QGraphicsTextItem_task172231(const QString & text, QGraphicsItem * parent = 0)
+ QGraphicsTextItem_task172231(const QString & text, QGraphicsItem * parent = nullptr)
: QGraphicsTextItem(text, parent) {}
QRectF exposedRect;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
@@ -3397,7 +3397,7 @@ void tst_QGraphicsView::task239729_noViewUpdate()
// The scene's changed signal is connected to something that isn't a view.
QGraphicsScene scene;
ChangedListener cl;
- QGraphicsView *view = 0;
+ QGraphicsView *view = nullptr;
if (a) {
view = new QGraphicsView(&scene);
@@ -4835,7 +4835,7 @@ void tst_QGraphicsView::hoverLeave()
class IMItem : public QGraphicsRectItem
{
public:
- IMItem(QGraphicsItem *parent = 0):
+ IMItem(QGraphicsItem *parent = nullptr):
QGraphicsRectItem(QRectF(0, 0, 20, 20), parent)
{
setFlag(QGraphicsItem::ItemIsFocusable, true);
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 4298cc3da7..f31b82b2bb 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -174,7 +174,7 @@ private slots:
// Subclass that exposes the protected functions.
class SubQGraphicsWidget : public QGraphicsWidget {
public:
- SubQGraphicsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags windowFlags = { })
+ SubQGraphicsWidget(QGraphicsItem *parent = nullptr, Qt::WindowFlags windowFlags = { })
: QGraphicsWidget(parent, windowFlags), eventCount(0)
{ }
@@ -254,7 +254,7 @@ protected:
class SizeHinter : public QGraphicsWidget
{
public:
- SizeHinter(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = { },
+ SizeHinter(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = { },
const QSizeF &min = QSizeF(5,5),
const QSizeF &pref = QSizeF(50, 50),
const QSizeF &max = QSizeF(500, 500))
@@ -382,7 +382,7 @@ void tst_QGraphicsWidget::dumpFocusChain()
// ### this test is very strange...
QFETCH(bool, scene);
SubQGraphicsWidget *parent = new SubQGraphicsWidget;
- QGraphicsScene *theScene = 0;
+ QGraphicsScene *theScene = nullptr;
if (scene) {
theScene = new QGraphicsScene(this);
theScene->addItem(parent);
@@ -518,7 +518,7 @@ void tst_QGraphicsWidget::focusWidget2()
class FocusWatchWidget : public QGraphicsWidget
{
public:
- FocusWatchWidget(QGraphicsItem *parent = 0) : QGraphicsWidget(parent) { gotFocusInCount = 0; gotFocusOutCount = 0; }
+ FocusWatchWidget(QGraphicsItem *parent = nullptr) : QGraphicsWidget(parent) { gotFocusInCount = 0; gotFocusOutCount = 0; }
int gotFocusInCount, gotFocusOutCount;
protected:
void focusInEvent(QFocusEvent *fe) { gotFocusInCount++; QGraphicsWidget::focusInEvent(fe); }
@@ -1396,7 +1396,7 @@ void tst_QGraphicsWidget::setTabOrder()
QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
- QGraphicsWidget *lastItem = 0;
+ QGraphicsWidget *lastItem = nullptr;
QTest::ignoreMessage(QtWarningMsg, "QGraphicsWidget::setTabOrder(0, 0) is undefined");
QGraphicsWidget::setTabOrder(0, 0);
@@ -2587,7 +2587,7 @@ void tst_QGraphicsWidget::shortcutsDeletion()
class MessUpPainterWidget : public QGraphicsWidget
{
public:
- MessUpPainterWidget(QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = { })
+ MessUpPainterWidget(QGraphicsItem * parent = nullptr, Qt::WindowFlags wFlags = { })
: QGraphicsWidget(parent, wFlags)
{}
@@ -3278,8 +3278,7 @@ void tst_QGraphicsWidget::itemSendGeometryPosChangesDeactivated()
item->setGeometry(QRectF(0, 0, 60, 60));
QCOMPARE(item->geometry(), QRectF(0, 0, 60, 60));
QCOMPARE(item->pos(), QPointF(0, 0));
- item->setPos(QPointF(10, 10));
- QCOMPARE(item->pos(), QPointF(10, 10));
+ item->setPos(QPointF(10, 10)); QCOMPARE(item->pos(), QPointF(10, 10));
QCOMPARE(item->geometry(), QRectF(10, 10, 60, 60));
}
@@ -3287,7 +3286,7 @@ class TabFocusWidget : public QGraphicsWidget
{
Q_OBJECT
public:
- TabFocusWidget(const QString &name, QGraphicsItem *parent = 0)
+ TabFocusWidget(const QString &name, QGraphicsItem *parent = nullptr)
: QGraphicsWidget(parent)
{ setFocusPolicy(Qt::TabFocus); setData(0, name); }
};
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
index 16f8b97d49..a8a39b7113 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
@@ -72,7 +72,7 @@ Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint)
class TestItemDelegate : public QItemDelegate
{
public:
- TestItemDelegate(QObject *parent = 0) : QItemDelegate(parent) {}
+ TestItemDelegate(QObject *parent = nullptr) : QItemDelegate(parent) {}
~TestItemDelegate() {}
void drawDisplay(QPainter *painter,
@@ -829,7 +829,7 @@ public:
m_editor = 0; // but clear the variable
}
- ChooseEditorDelegate(QObject *parent = 0) : QItemDelegate(parent) { }
+ ChooseEditorDelegate(QObject *parent = nullptr) : QItemDelegate(parent) { }
void setNextOpenEditor(QWidget *w) { m_editor = w; }
QWidget* currentEditor() const { return m_editor; }
private:
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index 00e82248d4..c63a3c6a52 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -70,15 +70,15 @@ public:
vspacing = 10;
}
- virtual int pixelMetric(PixelMetric metric, const QStyleOption * option = 0,
- const QWidget * widget = 0 ) const override;
+ virtual int pixelMetric(PixelMetric metric, const QStyleOption * option = nullptr,
+ const QWidget * widget = nullptr ) const override;
int hspacing;
int vspacing;
};
-int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * option /*= 0*/,
- const QWidget * widget /*= 0*/ ) const
+int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * option /*= nullptr*/,
+ const QWidget * widget /*= nullptr*/ ) const
{
switch (metric) {
case PM_LayoutLeftMargin:
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index 06e82ecac8..d718a6c7d7 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -297,15 +297,15 @@ public:
vspacing = 10;
}
- virtual int pixelMetric(PixelMetric metric, const QStyleOption * option = 0,
- const QWidget * widget = 0 ) const override;
+ virtual int pixelMetric(PixelMetric metric, const QStyleOption * option = nullptr,
+ const QWidget * widget = nullptr) const override;
int hspacing;
int vspacing;
};
-int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * option /*= 0*/,
- const QWidget * widget /*= 0*/ ) const
+int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * option /*= nullptr*/,
+ const QWidget * widget /*= nullptr*/ ) const
{
switch (metric) {
case PM_LayoutHorizontalSpacing:
@@ -391,7 +391,7 @@ void tst_QFormLayout::contentsRect()
class DummyMacStyle : public QCommonStyle
{
public:
- virtual int styleHint ( StyleHint hint, const QStyleOption * option = 0, const QWidget * widget = 0, QStyleHintReturn * returnData = 0 ) const override
+ virtual int styleHint ( StyleHint hint, const QStyleOption * option = 0, const QWidget * widget = nullptr, QStyleHintReturn * returnData = 0 ) const override
{
switch(hint) {
case SH_FormLayoutFormAlignment:
@@ -411,7 +411,7 @@ public:
class DummyQtopiaStyle : public QCommonStyle
{
public:
- virtual int styleHint ( StyleHint hint, const QStyleOption * option = 0, const QWidget * widget = 0, QStyleHintReturn * returnData = 0 ) const override
+ virtual int styleHint ( StyleHint hint, const QStyleOption * option = 0, const QWidget * widget = nullptr, QStyleHintReturn * returnData = 0 ) const override
{
switch(hint) {
case SH_FormLayoutFormAlignment:
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index 69d85df597..411ca7120e 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -381,9 +381,9 @@ void tst_QGridLayout::setMinAndMaxSize()
class SizeHinter : public QWidget
{
public:
- SizeHinter(const QSize &s, QWidget *parent = 0)
+ SizeHinter(const QSize &s, QWidget *parent = nullptr)
: QWidget(parent), sh(s) { }
- SizeHinter(int w, int h, QWidget *parent = 0)
+ SizeHinter(int w, int h, QWidget *parent = nullptr)
: QWidget(parent), sh(QSize(w,h)) {}
void setSizeHint(QSize s) { sh = s; }
QSize sizeHint() const override { return sh; }
@@ -489,7 +489,7 @@ typedef QList<QPoint> PointList;
class SizeHinterFrame : public QLabel
{
public:
- SizeHinterFrame(QWidget *parent = 0)
+ SizeHinterFrame(QWidget *parent = nullptr)
: QLabel(parent)
{
init(-1);
@@ -900,8 +900,8 @@ public:
reimplementSubelementRect = false;
}
- virtual int pixelMetric(PixelMetric metric, const QStyleOption * option = 0,
- const QWidget * widget = 0 ) const override;
+ virtual int pixelMetric(PixelMetric metric, const QStyleOption * option = nullptr,
+ const QWidget * widget = nullptr ) const override;
virtual QRect subElementRect(SubElement sr, const QStyleOption *opt,
const QWidget *widget) const override;
@@ -912,8 +912,8 @@ public:
int layoutSpacing(QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2,
Qt::Orientation orientation,
- const QStyleOption *option = 0,
- const QWidget *widget = 0) const override;
+ const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const override;
};
@@ -945,8 +945,8 @@ QRect CustomLayoutStyle::subElementRect(SubElement sr, const QStyleOption *opt,
int CustomLayoutStyle::layoutSpacing(QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2,
Qt::Orientation orientation,
- const QStyleOption * /*option = 0*/,
- const QWidget * /*widget = 0*/) const
+ const QStyleOption * /*option = nullptr*/,
+ const QWidget * /*widget = nullptr*/) const
{
if (orientation == Qt::Horizontal) {
switch (CT2(control1, control2)) {
@@ -966,8 +966,8 @@ int CustomLayoutStyle::layoutSpacing(QSizePolicy::ControlType control1,
}
}
-int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * option /*= 0*/,
- const QWidget * widget /*= 0*/ ) const
+int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * option /*= nullptr*/,
+ const QWidget * widget /*= nullptr*/ ) const
{
switch (metric) {
case PM_LayoutLeftMargin:
diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
index 053f4948a7..1b492d9a0f 100644
--- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
+++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
@@ -64,7 +64,7 @@ class Widget_task183679 : public QWidget
{
Q_OBJECT
public:
- Widget_task183679(QWidget *parent = 0) : QWidget(parent) {}
+ Widget_task183679(QWidget *parent = nullptr) : QWidget(parent) {}
void showDelayedToolTip(int msecs)
{
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 17b119410f..72e6c2ce32 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -966,7 +966,7 @@ class ResizeWidget : public QWidget
{
Q_OBJECT
public:
- ResizeWidget(QWidget *parent = 0)
+ ResizeWidget(QWidget *parent = nullptr)
: QWidget(parent)
, resizeCount(0)
{ }
@@ -1110,7 +1110,7 @@ class MoveWidget : public QWidget
{
Q_OBJECT
public:
- MoveWidget(QWidget *parent = 0)
+ MoveWidget(QWidget *parent = nullptr)
: QWidget(parent)
, moveCount(0)
{ }
diff --git a/tests/auto/widgets/kernel/qwidgetmetatype/tst_qwidgetmetatype.cpp b/tests/auto/widgets/kernel/qwidgetmetatype/tst_qwidgetmetatype.cpp
index 300320ca5d..1a6eb435a7 100644
--- a/tests/auto/widgets/kernel/qwidgetmetatype/tst_qwidgetmetatype.cpp
+++ b/tests/auto/widgets/kernel/qwidgetmetatype/tst_qwidgetmetatype.cpp
@@ -49,7 +49,7 @@ class CustomWidget : public QWidget
{
Q_OBJECT
public:
- CustomWidget(QWidget *parent = 0)
+ CustomWidget(QWidget *parent = nullptr)
: QWidget(parent)
{
diff --git a/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp b/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp
index 95bad0e903..18f07bbc42 100644
--- a/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp
+++ b/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp
@@ -149,7 +149,7 @@ void tst_QWidgetsVariant::writeToReadFromDataStream()
class CustomQWidget : public QWidget {
Q_OBJECT
public:
- CustomQWidget(QWidget *parent = 0) : QWidget(parent) {}
+ CustomQWidget(QWidget *parent = nullptr) : QWidget(parent) {}
};
void tst_QWidgetsVariant::qvariant_cast_QObject_data()
diff --git a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
index 4a5702b709..16fe57f330 100644
--- a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
+++ b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
@@ -75,7 +75,7 @@ private:
static int vgap(QWidget *widget1, QWidget *widget2) { return gap(widget1, widget2).height(); }
static void setSize(QWidget *widget, QStyleHelper::WidgetSizePolicy size);
static int spacing(ControlType control1, ControlType control2, Qt::Orientation orientation,
- QStyleOption *option = 0, QWidget *widget = 0);
+ QStyleOption *option = nullptr, QWidget *widget = nullptr);
static int hspacing(ControlType control1, ControlType control2, QStyleHelper::WidgetSizePolicy size = QStyleHelper::SizeLarge);
static int vspacing(ControlType control1, ControlType control2, QStyleHelper::WidgetSizePolicy size = QStyleHelper::SizeLarge);
};
diff --git a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
index 1d46886d1c..0bf7b73906 100644
--- a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
+++ b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
@@ -45,16 +45,16 @@ struct StyleOptionPointerBase
{
QStyleOption *pointer;
- StyleOptionPointerBase(QStyleOption *p = 0) : pointer(p) { }
+ StyleOptionPointerBase(QStyleOption *p = nullptr) : pointer(p) { }
- virtual ~StyleOptionPointerBase() { pointer = 0; }
+ virtual ~StyleOptionPointerBase() { pointer = nullptr; }
};
template <typename T>
struct StyleOptionPointer: public StyleOptionPointerBase
{
- StyleOptionPointer(T *p = 0): StyleOptionPointerBase(p) {}
- ~StyleOptionPointer() { delete static_cast<T *>(pointer); pointer = 0; }
+ StyleOptionPointer(T *p = nullptr): StyleOptionPointerBase(p) {}
+ ~StyleOptionPointer() { delete static_cast<T *>(pointer); pointer = nullptr; }
};
Q_DECLARE_METATYPE(StyleOptionPointerBase*)
@@ -94,25 +94,25 @@ void tst_QStyleOption::qstyleoptioncast()
QFETCH(bool, canCastToComplex);
QFETCH(int, type);
- QVERIFY(testOption->pointer != 0);
+ QVERIFY(testOption->pointer != nullptr);
QCOMPARE(testOption->pointer->type, type);
// Cast to common base class
QStyleOption *castOption = qstyleoption_cast<QStyleOption*>(testOption->pointer);
- QVERIFY(castOption != 0);
+ QVERIFY(castOption != nullptr);
// Cast to complex base class
castOption = qstyleoption_cast<QStyleOptionComplex*>(testOption->pointer);
- QCOMPARE(canCastToComplex, (castOption != 0));
+ QCOMPARE(canCastToComplex, (castOption != nullptr));
// Cast to combo box
castOption = qstyleoption_cast<QStyleOptionComboBox*>(testOption->pointer);
- QCOMPARE((castOption != 0),(testOption->pointer->type == QStyleOption::SO_ComboBox));
+ QCOMPARE((castOption != nullptr),(testOption->pointer->type == QStyleOption::SO_ComboBox));
// Cast to button
castOption = qstyleoption_cast<QStyleOptionButton*>(testOption->pointer);
- QCOMPARE((castOption != 0),(testOption->pointer->type == QStyleOption::SO_Button));
+ QCOMPARE((castOption != nullptr),(testOption->pointer->type == QStyleOption::SO_Button));
// Cast to lower version
testOption->pointer->version += 1;
diff --git a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
index 3b2bc1d126..26198c9aff 100644
--- a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
+++ b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
@@ -102,7 +102,7 @@ private:
class MyButton : public QAbstractButton
{
public:
- MyButton(QWidget *p = 0) : QAbstractButton(p) {}
+ MyButton(QWidget *p = nullptr) : QAbstractButton(p) {}
void paintEvent(QPaintEvent *) override
{
QPainter p(this);
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index c7d918fa6a..30f51e1d42 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -1822,7 +1822,7 @@ class ReturnClass : public QWidget
{
Q_OBJECT
public:
- ReturnClass(QWidget *parent = 0)
+ ReturnClass(QWidget *parent = nullptr)
: QWidget(parent), received(false)
{
QComboBox *box = new QComboBox(this);
@@ -2303,7 +2303,7 @@ class task166349_ComboBox : public QComboBox
{
Q_OBJECT
public:
- task166349_ComboBox(QWidget *parent = 0) : QComboBox(parent)
+ task166349_ComboBox(QWidget *parent = nullptr) : QComboBox(parent)
{
QStringList list;
list << "one" << "two";
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
index ef813c3021..e8aafa9c03 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -89,7 +89,7 @@ class EditorDateEdit : public QDateTimeEdit
{
Q_OBJECT
public:
- EditorDateEdit(QWidget *parent = 0) : QDateTimeEdit(parent) {}
+ EditorDateEdit(QWidget *parent = nullptr) : QDateTimeEdit(parent) {}
QLineEdit *lineEdit() { return QDateTimeEdit::lineEdit(); }
friend class tst_QDateTimeEdit;
};
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
index 04a68dd80f..66a4dff584 100644
--- a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -49,7 +49,7 @@ class DoubleSpinBox : public QDoubleSpinBox
{
Q_OBJECT
public:
- DoubleSpinBox(QWidget *parent = 0)
+ DoubleSpinBox(QWidget *parent = nullptr)
: QDoubleSpinBox(parent)
{ /*connect(this, SIGNAL(valueChanged(double)), this, SLOT(foo(double)));*/ }
QString textFromValue(double v) const override
@@ -1081,7 +1081,7 @@ void tst_QDoubleSpinBox::undoRedo()
struct task199226_DoubleSpinBox : public QDoubleSpinBox
{
- task199226_DoubleSpinBox(QWidget *parent = 0) : QDoubleSpinBox(parent) {}
+ task199226_DoubleSpinBox(QWidget *parent = nullptr) : QDoubleSpinBox(parent) {}
QLineEdit *lineEdit() { return QAbstractSpinBox::lineEdit(); }
};
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 9851e9edbd..e4bf36efaa 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -904,7 +904,7 @@ static const int chars = 8;
class ValidatorWithFixup : public QValidator
{
public:
- ValidatorWithFixup(QWidget *parent = 0)
+ ValidatorWithFixup(QWidget *parent = nullptr)
: QValidator(parent)
{}
@@ -3151,7 +3151,7 @@ void tst_QLineEdit::cutWithoutSelection()
class InputMaskValidator : public QValidator
{
public:
- InputMaskValidator(QObject *parent, const char *name = 0) : QValidator(parent) { setObjectName(name); }
+ InputMaskValidator(QObject *parent, const char *name = nullptr) : QValidator(parent) { setObjectName(name); }
State validate(QString &text, int &pos) const override
{
InputMaskValidator *that = (InputMaskValidator *)this;
@@ -3671,7 +3671,7 @@ void tst_QLineEdit::cursor()
class task180999_Widget : public QWidget
{
public:
- task180999_Widget(QWidget *parent = 0) : QWidget(parent)
+ task180999_Widget(QWidget *parent = nullptr) : QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
lineEdit1.setText("some text 1 ...");
@@ -3776,7 +3776,7 @@ class task198789_Widget : public QWidget
{
Q_OBJECT
public:
- task198789_Widget(QWidget *parent = 0) : QWidget(parent)
+ task198789_Widget(QWidget *parent = nullptr) : QWidget(parent)
{
QStringList wordList;
wordList << "alpha" << "omega" << "omicron" << "zeta";
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index b0fc8a3bfa..75721bf7a7 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -1456,7 +1456,7 @@ void tst_QMainWindow::createPopupMenu()
class MyDockWidget : public QDockWidget
{
public:
- MyDockWidget(QWidget * = 0) {
+ MyDockWidget(QWidget * = nullptr) {
create(); // otherwise hide() doesn't result in a hide event
}
};
@@ -1464,7 +1464,7 @@ public:
class MyWidget : public QWidget
{
public:
- MyWidget(QWidget *parent = 0) : QWidget(parent)
+ MyWidget(QWidget *parent = nullptr) : QWidget(parent)
{
}
@@ -1522,10 +1522,10 @@ void AddDockWidget::apply(QMainWindow *mw) const
dw->setObjectName(name);
dw->setWindowTitle(name);
- QDockWidget *other = 0;
+ QDockWidget *other = nullptr;
if (mode == SplitMode || mode == TabMode) {
other = mw->findChild<QDockWidget*>(this->other);
- QVERIFY(other != 0);
+ QVERIFY(other != nullptr);
}
switch (mode) {
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index 53dbf2012f..12593298e8 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -791,7 +791,7 @@ void tst_QMdiArea::changeModified()
class MyChild : public QWidget
{
public:
- MyChild(QWidget *parent = 0) : QWidget(parent) {}
+ MyChild(QWidget *parent = nullptr) : QWidget(parent) {}
QSize sizeHint() const override { return QSize(234, 123); }
};
@@ -865,7 +865,7 @@ void tst_QMdiArea::fixedSize()
class LargeWidget : public QWidget
{
public:
- LargeWidget(QWidget *parent = 0) : QWidget(parent) {}
+ LargeWidget(QWidget *parent = nullptr) : QWidget(parent) {}
QSize sizeHint() const override { return QSize(1280, 1024); }
QSize minimumSizeHint() const override { return QSize(300, 300); }
};
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 9a6cf3bfcf..e0f3381b8d 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -534,7 +534,7 @@ void tst_QMenu::statusTip()
QRect rect1 = tb.actionGeometry(&a);
QToolButton *btn = qobject_cast<QToolButton*>(tb.childAt(rect1.center()));
- QVERIFY(btn != NULL);
+ QVERIFY(btn != nullptr);
//because showMenu calls QMenu::exec, we need to use a singleshot
//to continue the test
@@ -1035,7 +1035,7 @@ void tst_QMenu::deleteActionInTriggered()
class PopulateOnAboutToShowTestMenu : public QMenu {
Q_OBJECT
public:
- explicit PopulateOnAboutToShowTestMenu(QWidget *parent = 0);
+ explicit PopulateOnAboutToShowTestMenu(QWidget *parent = nullptr);
public slots:
void populateMenu();
diff --git a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
index c14b3aa9d8..668d301205 100644
--- a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
+++ b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
@@ -80,7 +80,7 @@ void tst_QScrollArea::getSetCheck()
class WidgetWithMicroFocus : public QWidget
{
public:
- WidgetWithMicroFocus(QWidget *parent = 0) : QWidget(parent)
+ WidgetWithMicroFocus(QWidget *parent = nullptr) : QWidget(parent)
{
setBackgroundRole(QPalette::Dark);
}
diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
index 92771db764..a40ce538b2 100644
--- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
+++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
@@ -52,7 +52,7 @@ private slots:
class SingleStepTestScrollBar : public QScrollBar {
Q_OBJECT
public:
- explicit SingleStepTestScrollBar(Qt::Orientation o, QWidget *parent = 0) : QScrollBar(o, parent) {}
+ explicit SingleStepTestScrollBar(Qt::Orientation o, QWidget *parent = nullptr) : QScrollBar(o, parent) {}
public slots:
void hideAndShow()
@@ -99,7 +99,7 @@ void tst_QScrollBar::task_209492()
{
public:
int scrollCount;
- MyScrollArea(QWidget *parent = 0) : QScrollArea(parent), scrollCount(0) {}
+ MyScrollArea(QWidget *parent = nullptr) : QScrollArea(parent), scrollCount(0) {}
protected:
void paintEvent(QPaintEvent *) override { QTest::qSleep(600); }
void scrollContentsBy(int, int) override { ++scrollCount; viewport()->update(); }
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 35f796a37f..832635cc32 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -61,7 +61,7 @@
class SpinBox : public QSpinBox
{
public:
- SpinBox(QWidget *parent = 0)
+ SpinBox(QWidget *parent = nullptr)
: QSpinBox(parent)
{}
QString textFromValue(int v) const override
@@ -508,7 +508,7 @@ void tst_QSpinBox::valueChangedHelper(int value)
class ReadOnlyChangeTracker: public QSpinBox
{
public:
- ReadOnlyChangeTracker(QWidget *parent = 0) : QSpinBox(parent) {}
+ ReadOnlyChangeTracker(QWidget *parent = nullptr) : QSpinBox(parent) {}
void changeEvent(QEvent *ev) override
{
diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
index b63e917e5c..36cb15fa1f 100644
--- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
@@ -147,7 +147,7 @@ void tst_QSplitter::init()
void tst_QSplitter::removeThirdWidget()
{
delete w3;
- w3 = 0;
+ w3 = nullptr;
int handleWidth = splitter->style()->pixelMetric(QStyle::PM_SplitterWidth);
splitter->setFixedSize(400 + handleWidth, 400);
}
@@ -302,7 +302,7 @@ class TestSplitterStyle : public QProxyStyle
{
public:
TestSplitterStyle() : handleWidth(5) {}
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override
{
if (metric == QStyle::PM_SplitterWidth)
return handleWidth;
@@ -652,7 +652,7 @@ void tst_QSplitter::testRemoval()
class MyFriendlySplitter : public QSplitter
{
public:
- MyFriendlySplitter(QWidget *parent = 0) : QSplitter(parent) {}
+ MyFriendlySplitter(QWidget *parent = nullptr) : QSplitter(parent) {}
void setRubberBand(int pos) { QSplitter::setRubberBand(pos); }
void moveSplitter(int pos, int index) { QSplitter::moveSplitter(pos, index); }
diff --git a/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp b/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
index 2afbd44c03..c8e399f0f8 100644
--- a/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
+++ b/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
@@ -671,7 +671,7 @@ class TitleChangeTabBar : public QTabBar
int count;
public:
- TitleChangeTabBar(QWidget * parent = 0) : QTabBar(parent), count(0)
+ TitleChangeTabBar(QWidget * parent = nullptr) : QTabBar(parent), count(0)
{
setMovable(true);
addTab("0");
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index 4054e35e8d..a90ae9a55b 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -2642,7 +2642,7 @@ void tst_QTextEdit::findWithRegularExpressionReturnsFalseIfNoMoreResults()
class TextEdit : public QTextEdit
{
public:
- TextEdit(QWidget *parent = 0)
+ TextEdit(QWidget *parent = nullptr)
: QTextEdit(parent)
{}
void wheelEvent(QWheelEvent *event) override