diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2018-07-27 15:27:27 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2018-07-29 21:09:47 +0000 |
commit | 3fa22f19a60c3f6376c23ffa6b652b0b5438abc4 (patch) | |
tree | 0996ea15a0565ffb36ff8cee7a90b3a0ee437548 /src/libs/aggregation | |
parent | 11632bbeddb9a4a742eef0df37f7cf1aecebe9a2 (diff) |
Aggregation: Modernize
modernize-use-nullptr
Change-Id: I8775e7f4bdfed143a59c791d86f4b1acf11bcc73
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/aggregation')
-rw-r--r-- | src/libs/aggregation/aggregate.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libs/aggregation/aggregate.h b/src/libs/aggregation/aggregate.h index 13881d85d8..8c3332bf81 100644 --- a/src/libs/aggregation/aggregate.h +++ b/src/libs/aggregation/aggregate.h @@ -40,7 +40,7 @@ class AGGREGATION_EXPORT Aggregate : public QObject Q_OBJECT public: - Aggregate(QObject *parent = 0); + Aggregate(QObject *parent = nullptr); ~Aggregate() override; void add(QObject *component); @@ -52,7 +52,7 @@ public: if (T *result = qobject_cast<T *>(component)) return result; } - return (T *)0; + return nullptr; } template <typename T> QList<T *> components() { @@ -84,19 +84,19 @@ private: template <typename T> T *query(Aggregate *obj) { if (!obj) - return (T *)0; + return nullptr; return obj->template component<T>(); } template <typename T> T *query(QObject *obj) { if (!obj) - return (T *)0; + return nullptr; T *result = qobject_cast<T *>(obj); if (!result) { QReadLocker locker(&Aggregate::lock()); Aggregate *parentAggregation = Aggregate::parentAggregate(obj); - result = (parentAggregation ? query<T>(parentAggregation) : 0); + result = (parentAggregation ? query<T>(parentAggregation) : nullptr); } return result; } |