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 /src/quick/items/qquickitem_p.h | |
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 'src/quick/items/qquickitem_p.h')
-rw-r--r-- | src/quick/items/qquickitem_p.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index ee854bb2ac..2e91e2111c 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -97,7 +97,7 @@ public: QRectF rectF() const { return m_contents; } - inline void calcGeometry(QQuickItem *changed = 0); + inline void calcGeometry(QQuickItem *changed = nullptr); void complete(); protected: @@ -108,8 +108,8 @@ protected: //void itemVisibilityChanged(QQuickItem *item) private: - bool calcHeight(QQuickItem *changed = 0); - bool calcWidth(QQuickItem *changed = 0); + bool calcHeight(QQuickItem *changed = nullptr); + bool calcWidth(QQuickItem *changed = nullptr); void updateRect(); QQuickItem *m_item; @@ -330,7 +330,7 @@ public: Q_DECLARE_FLAGS(ChangeTypes, ChangeType) struct ChangeListener { - ChangeListener(QQuickItemChangeListener *l = nullptr, QQuickItemPrivate::ChangeTypes t = 0) : listener(l), types(t), gTypes(QQuickGeometryChange::All) {} + ChangeListener(QQuickItemChangeListener *l = nullptr, QQuickItemPrivate::ChangeTypes t = nullptr) : listener(l), types(t), gTypes(QQuickGeometryChange::All) {} ChangeListener(QQuickItemChangeListener *l, QQuickGeometryChange gt) : listener(l), types(Geometry), gTypes(gt) {} QQuickItemChangeListener *listener; QQuickItemPrivate::ChangeTypes types; @@ -605,9 +605,9 @@ public: - (rootNode) (shader effect source's root node) */ - QSGOpacityNode *opacityNode() const { return extra.isAllocated()?extra->opacityNode:0; } - QQuickDefaultClipNode *clipNode() const { return extra.isAllocated()?extra->clipNode:0; } - QSGRootNode *rootNode() const { return extra.isAllocated()?extra->rootNode:0; } + QSGOpacityNode *opacityNode() const { return extra.isAllocated()?extra->opacityNode:nullptr; } + QQuickDefaultClipNode *clipNode() const { return extra.isAllocated()?extra->clipNode:nullptr; } + QSGRootNode *rootNode() const { return extra.isAllocated()?extra->rootNode:nullptr; } QSGTransformNode *itemNodeInstance; QSGNode *paintNode; @@ -639,7 +639,7 @@ public: class QQuickItemKeyFilter { public: - QQuickItemKeyFilter(QQuickItem * = 0); + QQuickItemKeyFilter(QQuickItem * = nullptr); virtual ~QQuickItemKeyFilter(); virtual void keyPressed(QKeyEvent *event, bool post); @@ -662,7 +662,7 @@ class QQuickKeyNavigationAttachedPrivate : public QObjectPrivate public: QQuickKeyNavigationAttachedPrivate() : QObjectPrivate(), - left(0), right(0), up(0), down(0), tab(0), backtab(0), + left(nullptr), right(nullptr), up(nullptr), down(nullptr), tab(nullptr), backtab(nullptr), leftSet(false), rightSet(false), upSet(false), downSet(false), tabSet(false), backtabSet(false) {} @@ -694,7 +694,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickKeyNavigationAttached : public QObject, publi Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged) public: - QQuickKeyNavigationAttached(QObject * = 0); + QQuickKeyNavigationAttached(QObject * = nullptr); QQuickItem *left() const; void setLeft(QQuickItem *); @@ -739,7 +739,7 @@ class QQuickLayoutMirroringAttached : public QObject Q_PROPERTY(bool childrenInherit READ childrenInherit WRITE setChildrenInherit NOTIFY childrenInheritChanged) public: - explicit QQuickLayoutMirroringAttached(QObject *parent = 0); + explicit QQuickLayoutMirroringAttached(QObject *parent = nullptr); bool enabled() const; void setEnabled(bool); @@ -783,7 +783,7 @@ class QQuickKeysAttachedPrivate : public QObjectPrivate public: QQuickKeysAttachedPrivate() : QObjectPrivate(), inPress(false), inRelease(false) - , inIM(false), enabled(true), imeItem(0), item(0) + , inIM(false), enabled(true), imeItem(nullptr), item(nullptr) {} //loop detection @@ -809,7 +809,7 @@ class QQuickKeysAttached : public QObject, public QQuickItemKeyFilter Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged) public: - QQuickKeysAttached(QObject *parent=0); + QQuickKeysAttached(QObject *parent=nullptr); ~QQuickKeysAttached(); bool enabled() const { Q_D(const QQuickKeysAttached); return d->enabled; } @@ -898,7 +898,7 @@ private: Qt::MouseButtons QQuickItemPrivate::acceptedMouseButtons() const { return ((extra.flag() ? Qt::LeftButton : Qt::MouseButton(0)) | - (extra.isAllocated() ? extra->acceptedMouseButtons : Qt::MouseButtons(0))); + (extra.isAllocated() ? extra->acceptedMouseButtons : Qt::MouseButtons(nullptr))); } QSGContext *QQuickItemPrivate::sceneGraphContext() const @@ -920,7 +920,7 @@ void QQuickItemPrivate::markSortedChildrenDirty(QQuickItem *child) if (child->z() != 0. || sortedChildItems != &childItems) { if (sortedChildItems != &childItems) delete sortedChildItems; - sortedChildItems = 0; + sortedChildItems = nullptr; } } |