From bf0b5dc5164813fa77fee0e536821b7eaa48594c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 1 Jul 2022 13:03:50 +0200 Subject: [PATCH] qgraphicsitem_cast: replace 0 with nullptr While headerscheck doesn't detect this (generic code), this might trigger warnings in user code. Change-Id: I6183323d0a1c73b021699d4c4afa2d1fcf71aad2 Reviewed-by: Giuseppe D'Angelo (cherry picked from commit a9cabed4399fa73cdd741d781426205128c35ea3) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/graphicsview/qgraphicsitem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h index e1732ff3929..e4bd7a8fe89 100644 --- a/src/widgets/graphicsview/qgraphicsitem.h +++ b/src/widgets/graphicsview/qgraphicsitem.h @@ -973,14 +973,14 @@ template inline T qgraphicsitem_cast(QGraphicsItem *item) { typedef typename std::remove_cv::type>::type Item; return int(Item::Type) == int(QGraphicsItem::Type) - || (item && int(Item::Type) == item->type()) ? static_cast(item) : 0; + || (item && int(Item::Type) == item->type()) ? static_cast(item) : nullptr; } template inline T qgraphicsitem_cast(const QGraphicsItem *item) { typedef typename std::remove_cv::type>::type Item; return int(Item::Type) == int(QGraphicsItem::Type) - || (item && int(Item::Type) == item->type()) ? static_cast(item) : 0; + || (item && int(Item::Type) == item->type()) ? static_cast(item) : nullptr; } #ifndef QT_NO_DEBUG_STREAM