aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-02-21 10:41:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-26 07:13:18 +0000
commit499ec43937e926e4f2fa57a9baa455fcb3862262 (patch)
tree206c90d47387f8322b68f5e3db613189397e1af3 /src/quick/items/qquicktextinput.cpp
parent53d1e9ed21d25e65a2f13606af479838f5f21fe7 (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 'src/quick/items/qquicktextinput.cpp')
-rw-r--r--src/quick/items/qquicktextinput.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 557ff393b4..b19c13c5ee 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -1863,7 +1863,7 @@ void QQuickTextInput::invalidateFontCaches()
{
Q_D(QQuickTextInput);
- if (d->m_textLayout.engine() != 0)
+ if (d->m_textLayout.engine() != nullptr)
d->m_textLayout.engine()->resetFontEngineCache();
}
@@ -1886,7 +1886,7 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
Q_UNUSED(data);
Q_D(QQuickTextInput);
- if (d->updateType != QQuickTextInputPrivate::UpdatePaintNode && oldNode != 0) {
+ if (d->updateType != QQuickTextInputPrivate::UpdatePaintNode && oldNode != nullptr) {
// Update done in preprocess() in the nodes
d->updateType = QQuickTextInputPrivate::UpdateNone;
return oldNode;
@@ -1895,13 +1895,13 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
d->updateType = QQuickTextInputPrivate::UpdateNone;
QQuickTextNode *node = static_cast<QQuickTextNode *>(oldNode);
- if (node == 0)
+ if (node == nullptr)
node = new QQuickTextNode(this);
d->textNode = node;
- const bool showCursor = !isReadOnly() && d->cursorItem == 0 && d->cursorVisible && d->m_blinkStatus;
+ const bool showCursor = !isReadOnly() && d->cursorItem == nullptr && d->cursorVisible && d->m_blinkStatus;
- if (!d->textLayoutDirty && oldNode != 0) {
+ if (!d->textLayoutDirty && oldNode != nullptr) {
if (showCursor)
node->setCursor(cursorRectangle(), d->color);
else
@@ -3828,7 +3828,7 @@ void QQuickTextInputPrivate::parseInputMask(const QString &maskFields)
if (maskFields.isEmpty() || delimiter == 0) {
if (m_maskData) {
delete [] m_maskData;
- m_maskData = 0;
+ m_maskData = nullptr;
m_maxLength = 32767;
internalSetText(QString());
}