diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-21 10:41:54 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-26 07:13:18 +0000 |
commit | 499ec43937e926e4f2fa57a9baa455fcb3862262 (patch) | |
tree | 206c90d47387f8322b68f5e3db613189397e1af3 /tests/auto/qml/qqmlincubator/testtypes.cpp | |
parent | 53d1e9ed21d25e65a2f13606af479838f5f21fe7 (diff) |
use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlincubator/testtypes.cpp')
-rw-r--r-- | tests/auto/qml/qqmlincubator/testtypes.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/auto/qml/qqmlincubator/testtypes.cpp b/tests/auto/qml/qqmlincubator/testtypes.cpp index 3fcd3ba299..06d5904bbd 100644 --- a/tests/auto/qml/qqmlincubator/testtypes.cpp +++ b/tests/auto/qml/qqmlincubator/testtypes.cpp @@ -28,7 +28,7 @@ #include "testtypes.h" #include <QtQml/qqml.h> -SelfRegisteringType *SelfRegisteringType::m_me = 0; +SelfRegisteringType *SelfRegisteringType::m_me = nullptr; SelfRegisteringType::SelfRegisteringType() : m_v(0) { @@ -42,13 +42,13 @@ SelfRegisteringType *SelfRegisteringType::me() void SelfRegisteringType::clearMe() { - m_me = 0; + m_me = nullptr; } -SelfRegisteringOuterType *SelfRegisteringOuterType::m_me = 0; +SelfRegisteringOuterType *SelfRegisteringOuterType::m_me = nullptr; bool SelfRegisteringOuterType::beenDeleted = false; SelfRegisteringOuterType::SelfRegisteringOuterType() -: m_v(0) +: m_v(nullptr) { m_me = this; beenDeleted = false; @@ -64,7 +64,7 @@ SelfRegisteringOuterType *SelfRegisteringOuterType::me() return m_me; } -CompletionRegisteringType *CompletionRegisteringType::m_me = 0; +CompletionRegisteringType *CompletionRegisteringType::m_me = nullptr; CompletionRegisteringType::CompletionRegisteringType() { } @@ -85,11 +85,11 @@ CompletionRegisteringType *CompletionRegisteringType::me() void CompletionRegisteringType::clearMe() { - m_me = 0; + m_me = nullptr; } -CallbackRegisteringType::callback CallbackRegisteringType::m_callback = 0; -void *CallbackRegisteringType::m_data = 0; +CallbackRegisteringType::callback CallbackRegisteringType::m_callback = nullptr; +void *CallbackRegisteringType::m_data = nullptr; CallbackRegisteringType::CallbackRegisteringType() : m_v(0) { @@ -97,8 +97,8 @@ CallbackRegisteringType::CallbackRegisteringType() void CallbackRegisteringType::clearCallback() { - m_callback = 0; - m_data = 0; + m_callback = nullptr; + m_data = nullptr; } void CallbackRegisteringType::registerCallback(callback c, void *d) @@ -107,8 +107,8 @@ void CallbackRegisteringType::registerCallback(callback c, void *d) m_data = d; } -CompletionCallbackType::callback CompletionCallbackType::m_callback = 0; -void *CompletionCallbackType::m_data = 0; +CompletionCallbackType::callback CompletionCallbackType::m_callback = nullptr; +void *CompletionCallbackType::m_data = nullptr; CompletionCallbackType::CompletionCallbackType() { } @@ -124,8 +124,8 @@ void CompletionCallbackType::componentComplete() void CompletionCallbackType::clearCallback() { - m_callback = 0; - m_data = 0; + m_callback = nullptr; + m_data = nullptr; } void CompletionCallbackType::registerCallback(callback c, void *d) |