aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextedit.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/qquicktextedit.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/qquicktextedit.cpp')
-rw-r--r--src/quick/items/qquicktextedit.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index 10abc1176a..352fc48970 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -139,7 +139,7 @@ namespace {
class RootNode : public QSGTransformNode
{
public:
- RootNode() : cursorNode(0), frameDecorationsNode(0)
+ RootNode() : cursorNode(nullptr), frameDecorationsNode(nullptr)
{ }
void resetFrameDecorations(QQuickTextNode* newNode)
@@ -1991,12 +1991,12 @@ static inline void updateNodeTransform(QQuickTextNode* node, const QPointF &topL
void QQuickTextEdit::invalidateFontCaches()
{
Q_D(QQuickTextEdit);
- if (d->document == 0)
+ if (d->document == nullptr)
return;
QTextBlock block;
for (block = d->document->firstBlock(); block.isValid(); block = block.next()) {
- if (block.layout() != 0 && block.layout()->engine() != 0)
+ if (block.layout() != nullptr && block.layout()->engine() != nullptr)
block.layout()->engine()->resetFontEngineCache();
}
}
@@ -2014,7 +2014,7 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
Q_UNUSED(updatePaintNodeData);
Q_D(QQuickTextEdit);
- if (d->updateType != QQuickTextEditPrivate::UpdatePaintNode && oldNode != 0) {
+ if (d->updateType != QQuickTextEditPrivate::UpdatePaintNode && oldNode != nullptr) {
// Update done in preprocess() in the nodes
d->updateType = QQuickTextEditPrivate::UpdateNone;
return oldNode;
@@ -2055,7 +2055,7 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
rootNode->resetFrameDecorations(d->createTextNode());
resetEngine(&frameDecorationsEngine, d->color, d->selectedTextColor, d->selectionColor);
- QQuickTextNode *node = 0;
+ QQuickTextNode *node = nullptr;
int currentNodeSize = 0;
int nodeStart = firstDirtyPos;
@@ -2159,8 +2159,8 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
std::sort(d->textNodeMap.begin(), d->textNodeMap.end());
}
- if (d->cursorComponent == 0) {
- QSGInternalRectangleNode* cursor = 0;
+ if (d->cursorComponent == nullptr) {
+ QSGInternalRectangleNode* cursor = nullptr;
if (!isReadOnly() && d->cursorVisible && d->control->cursorOn())
cursor = d->sceneGraphContext()->createInternalRectangleNode(d->control->cursorRect(), d->color);
rootNode->resetCursorNode(cursor);