From 499ec43937e926e4f2fa57a9baa455fcb3862262 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 21 Feb 2018 10:41:54 +0100 Subject: 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 --- src/quick/items/qquicktextinput.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/quick/items/qquicktextinput.cpp') 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(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()); } -- cgit v1.2.3