qwsi: Teach handleContextMenuEvent about synchronous delivery
Which also lets it return the acceptance state of the event. At the moment the acceptance state of QContextMenuEvent is a bit of a mess, so the QWSI acceptance state can't be trusted, but this opens up the door to using it at a later point. Task-number: QTBUG-67331 Change-Id: I75b586f90e25122bc9e25880d3787740b025c892 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit bbc3a7d7ba683c71de4662a1eeac0b7d3dfa6b11) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
c3fd08e42c
commit
787b221308
@ -68,6 +68,17 @@ bool QPageLayout::setBottomMargin(qreal bottomMargin)
|
||||
return setBottomMargin(bottomMargin, OutOfBoundsPolicy::Reject);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_CONTEXTMENU
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
void QWindowSystemInterface::handleContextMenuEvent(QWindow *window, bool mouseTriggered,
|
||||
const QPoint &pos, const QPoint &globalPos,
|
||||
Qt::KeyboardModifiers modifiers)
|
||||
{
|
||||
handleContextMenuEvent<QWindowSystemInterface::DefaultDelivery>(
|
||||
window, mouseTriggered, pos, globalPos, modifiers);
|
||||
}
|
||||
#endif // QT_NO_CONTEXTMENU
|
||||
|
||||
// #include "qotherheader.h"
|
||||
// // implement removed functions from qotherheader.h
|
||||
// order sections alphabetically
|
||||
|
@ -3072,6 +3072,7 @@ void QGuiApplicationPrivate::processContextMenuEvent(QWindowSystemInterfacePriva
|
||||
|
||||
QContextMenuEvent ev(QContextMenuEvent::Keyboard, e->pos, e->globalPos, e->modifiers);
|
||||
QGuiApplication::sendSpontaneousEvent(e->window.data(), &ev);
|
||||
e->eventAccepted = ev.isAccepted();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1028,12 +1028,12 @@ void QWindowSystemInterface::handlePlatformPanelEvent(QWindow *w)
|
||||
}
|
||||
|
||||
#ifndef QT_NO_CONTEXTMENU
|
||||
void QWindowSystemInterface::handleContextMenuEvent(QWindow *window, bool mouseTriggered,
|
||||
QT_DEFINE_QPA_EVENT_HANDLER(bool, handleContextMenuEvent, QWindow *window, bool mouseTriggered,
|
||||
const QPoint &pos, const QPoint &globalPos,
|
||||
Qt::KeyboardModifiers modifiers)
|
||||
{
|
||||
handleWindowSystemEvent<QWindowSystemInterfacePrivate::ContextMenuEvent>(window,
|
||||
mouseTriggered, pos, globalPos, modifiers);
|
||||
return handleWindowSystemEvent<QWindowSystemInterfacePrivate::ContextMenuEvent, Delivery>(
|
||||
window, mouseTriggered, pos, globalPos, modifiers);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -248,10 +248,17 @@ public:
|
||||
#endif // QT_NO_GESTURES
|
||||
|
||||
static void handlePlatformPanelEvent(QWindow *window);
|
||||
|
||||
#ifndef QT_NO_CONTEXTMENU
|
||||
#if QT_GUI_REMOVED_SINCE(6, 8)
|
||||
static void handleContextMenuEvent(QWindow *window, bool mouseTriggered,
|
||||
const QPoint &pos, const QPoint &globalPos,
|
||||
Qt::KeyboardModifiers modifiers);
|
||||
#endif
|
||||
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
|
||||
static bool handleContextMenuEvent(QWindow *window, bool mouseTriggered,
|
||||
const QPoint &pos, const QPoint &globalPos,
|
||||
Qt::KeyboardModifiers modifiers);
|
||||
#endif
|
||||
#if QT_CONFIG(whatsthis)
|
||||
static void handleEnterWhatsThisEvent();
|
||||
|
Loading…
x
Reference in New Issue
Block a user