diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-02-25 17:07:49 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-03-04 05:49:36 +0000 |
commit | 2c42df30340041883654360816d5b767d433cd95 (patch) | |
tree | 5b41638d6fec9b2166e1f3237f27ce6442fd2a11 | |
parent | ef34c990779cfcb068f86dd5dacfc4a7e7b58743 (diff) |
QGraphicsWidget: don't dereference nullptr
Unlikely that one item is nullptr and the other item doesn't have a
scene, but we do already test for the scene pointer, so don't continue
if it's nullptr.
Fixes static analyzer warning f59576ecf6618447c4f9c7be93fc737f
Change-Id: I6d436bb1211ddd412821d6978bab25192033f5e5
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit d984fd13adf1592646eafa9912bce44ee2158d92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/widgets/graphicsview/qgraphicswidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index fea9e18b9c..a4b1b8ea6c 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/graphicsview/qgraphicswidget.cpp @@ -2143,7 +2143,7 @@ void QGraphicsWidget::setTabOrder(QGraphicsWidget *first, QGraphicsWidget *secon return; } QGraphicsScene *scene = first ? first->scene() : second->scene(); - if (!scene && (!first || !second)) { + if (!scene) { qWarning("QGraphicsWidget::setTabOrder: assigning tab order from/to the" " scene requires the item to be in a scene."); return; |