From 3ed7a5a963b89554de9ebdb025c2783b4cee8177 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 13 Jan 2022 22:56:30 +0100 Subject: [PATCH] QWindow: Remove unnecessary cast We already have a QMouseEvent, don't static_cast the QEvent again to the parent-class of QMouseEvent. Pick-to: 6.3 6.2 Change-Id: Ifd8a5a82d0a8ded564a68ec4f3ae877886c6e1c7 Reviewed-by: Marc Mutz --- src/gui/kernel/qwindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index dc55c3c7876..2a2a2c542fc 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2566,9 +2566,8 @@ bool QWindow::event(QEvent *ev) }; if (QMouseEvent *me = asMouseEvent(ev); me && ev->type() == contextMenuTrigger && me->button() == Qt::RightButton) { - QSinglePointEvent *pev = static_cast(ev); QContextMenuEvent e(QContextMenuEvent::Mouse, me->position().toPoint(), - pev->globalPosition().toPoint(), pev->modifiers()); + me->globalPosition().toPoint(), me->modifiers()); QGuiApplication::sendEvent(this, &e); } #endif