4#include <QtCore/private/qohoscommon_p.h>
5#include <render/qohoshovereventsgenerator.h>
18 QtOhos::QThreadSafeRef<QWindow> qWindowRef,
19 QtOhos::QThreadSafeRef<QOhosInputMethodEventHandler> imEventHandlerRef);
25 void sendQtHoverEvent(
bool isHover);
27 QtOhos::QThreadSafeRef<QWindow> m_qWindowRef;
28 QtOhos::QThreadSafeRef<QOhosInputMethodEventHandler> m_imEventHandlerRef;
30 QOhosOptional<QPointF> m_optCurrentLocalPosition;
31 QOhosOptional<QPointF> m_optCurrentGlobalPosition;
36 QtOhos::QThreadSafeRef<QWindow> qWindowRef,
37 QtOhos::QThreadSafeRef<QOhosInputMethodEventHandler> imEventHandlerRef)
46 m_optCurrentLocalPosition = mouseEvent.localPosition;
47 m_optCurrentGlobalPosition = mouseEvent.globalPosition;
50 sendQtHoverEvent(
true);
57 const auto localPosition = m_optCurrentLocalPosition.value_or(fallbackLocalPositionWhenUnknown);
58 const auto globalPosition = m_optCurrentGlobalPosition.value_or(fallbackGlobalPositionWhenUnknown);
60 m_imEventHandlerRef.visitInQtThreadIfAlive(
61 [isHover, localPosition, globalPosition, qWindowRef = m_qWindowRef](QOhosInputMethodEventHandler &imEventHandler) {
62 QWindow *qWindow = qWindowRef.data();
63 if (qWindow !=
nullptr) {
64 imEventHandler.onHoverEvent(
66 .targetWindow = qWindow,
67 .localPosition = localPosition,
68 .globalPosition = globalPosition,
77 if (!hovered && m_hovered) {
78 sendQtHoverEvent(
false);
90 QtOhos::QThreadSafeRef<QWindow> qWindowRef,
91 QtOhos::QThreadSafeRef<QOhosInputMethodEventHandler> imEventHandlerRef)
93 return std::make_shared<QOhosHoverEventsGeneratorImpl>(qWindowRef, imEventHandlerRef);
virtual ~QOhosHoverEventsGenerator()
QOhosHoverEventsGenerator()
void handleQOhosMouseEvent(const QOhosMouseEvent &mouseEvent) override
QOhosHoverEventsGeneratorImpl(QtOhos::QThreadSafeRef< QWindow > qWindowRef, QtOhos::QThreadSafeRef< QOhosInputMethodEventHandler > imEventHandlerRef)
void handleQOhosHoverEvent(bool hovered) override
Combined button and popup list for selecting options.
const QPointF fallbackGlobalPositionWhenUnknown
const QPointF fallbackLocalPositionWhenUnknown
std::shared_ptr< QOhosHoverEventsGenerator > makeQOhosHoverEventsGenerator(QtOhos::QThreadSafeRef< QWindow > qWindowRef, QtOhos::QThreadSafeRef< QOhosInputMethodEventHandler > imEventHandlerRef)