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 f6befd3e63 and fixes report
020fbdde70065e8de370537304d13d21.

Change-Id: I715764956a02b1300766a3cea2d427f840f1cec8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Volker Hilsheimer 2021-10-04 18:04:11 +02:00
parent 4d47b18c81
commit 638e0c3144

View File

@ -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();