aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickstateoperations.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/qquickstateoperations.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/qquickstateoperations.cpp')
-rw-r--r--src/quick/items/qquickstateoperations.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp
index 386bb058b5..a85b9663d3 100644
--- a/src/quick/items/qquickstateoperations.cpp
+++ b/src/quick/items/qquickstateoperations.cpp
@@ -51,8 +51,8 @@ class QQuickParentChangePrivate : public QQuickStateOperationPrivate
{
Q_DECLARE_PUBLIC(QQuickParentChange)
public:
- QQuickParentChangePrivate() : target(0), parent(0), origParent(0), origStackBefore(0),
- rewindParent(0), rewindStackBefore(0) {}
+ QQuickParentChangePrivate() : target(nullptr), parent(nullptr), origParent(nullptr), origStackBefore(nullptr),
+ rewindParent(nullptr), rewindStackBefore(nullptr) {}
QQuickItem *target;
QPointer<QQuickItem> parent;
@@ -68,7 +68,7 @@ public:
QQmlNullableValue<QQmlScriptString> scaleString;
QQmlNullableValue<QQmlScriptString> rotationString;
- void doChange(QQuickItem *targetParent, QQuickItem *stackBefore = 0);
+ void doChange(QQuickItem *targetParent, QQuickItem *stackBefore = nullptr);
};
void QQuickParentChangePrivate::doChange(QQuickItem *targetParent, QQuickItem *stackBefore)
@@ -524,13 +524,13 @@ void QQuickParentChange::saveCurrentValues()
{
Q_D(QQuickParentChange);
if (!d->target) {
- d->rewindParent = 0;
- d->rewindStackBefore = 0;
+ d->rewindParent = nullptr;
+ d->rewindStackBefore = nullptr;
return;
}
d->rewindParent = d->target->parentItem();
- d->rewindStackBefore = 0;
+ d->rewindStackBefore = nullptr;
if (!d->rewindParent)
return;
@@ -588,7 +588,7 @@ class QQuickAnchorSetPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QQuickAnchorSet)
public:
QQuickAnchorSetPrivate()
- : usedAnchors(0), resetAnchors(0)
+ : usedAnchors(nullptr), resetAnchors(nullptr)
{
}
@@ -771,7 +771,7 @@ class QQuickAnchorChangesPrivate : public QQuickStateOperationPrivate
{
public:
QQuickAnchorChangesPrivate()
- : target(0), anchorSet(new QQuickAnchorSet)
+ : target(nullptr), anchorSet(new QQuickAnchorSet)
{
}
@@ -855,7 +855,7 @@ QQuickAnchorChanges::ActionList QQuickAnchorChanges::actions()
Q_D(QQuickAnchorChanges);
//### ASSERT these are all 0?
d->leftBinding = d->rightBinding = d->hCenterBinding = d->topBinding
- = d->bottomBinding = d->vCenterBinding = d->baselineBinding = 0;
+ = d->bottomBinding = d->vCenterBinding = d->baselineBinding = nullptr;
d->leftProp = QQmlProperty(d->target, QLatin1String("anchors.left"));
d->rightProp = QQmlProperty(d->target, QLatin1String("anchors.right"));
@@ -1236,20 +1236,20 @@ void QQuickAnchorChanges::copyOriginals(QQuickStateActionEvent *other)
//clear old values from other
//### could this be generalized for all QQuickStateActionEvents, and called after copyOriginals?
- acp->leftBinding = 0;
- acp->rightBinding = 0;
- acp->hCenterBinding = 0;
- acp->topBinding = 0;
- acp->bottomBinding = 0;
- acp->vCenterBinding = 0;
- acp->baselineBinding = 0;
- acp->origLeftBinding = 0;
- acp->origRightBinding = 0;
- acp->origHCenterBinding = 0;
- acp->origTopBinding = 0;
- acp->origBottomBinding = 0;
- acp->origVCenterBinding = 0;
- acp->origBaselineBinding = 0;
+ acp->leftBinding = nullptr;
+ acp->rightBinding = nullptr;
+ acp->hCenterBinding = nullptr;
+ acp->topBinding = nullptr;
+ acp->bottomBinding = nullptr;
+ acp->vCenterBinding = nullptr;
+ acp->baselineBinding = nullptr;
+ acp->origLeftBinding = nullptr;
+ acp->origRightBinding = nullptr;
+ acp->origHCenterBinding = nullptr;
+ acp->origTopBinding = nullptr;
+ acp->origBottomBinding = nullptr;
+ acp->origVCenterBinding = nullptr;
+ acp->origBaselineBinding = nullptr;
saveCurrentValues();
}