summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-10-04 18:04:11 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-10-07 10:54:10 +0000
commit638e0c3144498f0072169793a49b223743fba804 (patch)
tree7bd8730f017aeb36b87bb723fe1fd64edd1dc804 /src/widgets/kernel/qapplication.cpp
parent4d47b18c81f74ae6855e16197a12b69a6bcfe68a (diff)
Silence static analyzer warning
The static analyzer can't see that the QPointer not being null implies that the QWidget pointer is still valid. Since we reset the widget pointer to nullptr earlier on if the QPointer is null, just test for the widget pointer instead. Amends f6befd3e63fba32ae3f8329630e3ee4af3babbdc and fixes report 020fbdde70065e8de370537304d13d21. Change-Id: I715764956a02b1300766a3cea2d427f840f1cec8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index cea0f97bbd..a54a17552f 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3156,7 +3156,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
if (gesturePendingWidget.isNull() && w && QGestureManager::gesturePending(w))
gesturePendingWidget = w;
#endif
- if (p.isNull() || w->isWindow()|| w->testAttribute(Qt::WA_NoMousePropagation))
+ if (!w || w->isWindow() || w->testAttribute(Qt::WA_NoMousePropagation))
break;
const QPoint offset = w->pos();