From 638e0c3144498f0072169793a49b223743fba804 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 4 Oct 2021 18:04:11 +0200 Subject: [PATCH] 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 --- src/widgets/kernel/qapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();