From 047946fc4868f5dc52615929b1b7faa5ac8b8976 Mon Sep 17 00:00:00 2001 From: zeljko Date: Sat, 31 Dec 2016 15:05:23 +0000 Subject: [PATCH] Qt5: pass MouseUp event from transparent widget to the LCL. part of issue #30232 git-svn-id: trunk@53819 - --- lcl/interfaces/qt5/qtwidgets.pas | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lcl/interfaces/qt5/qtwidgets.pas b/lcl/interfaces/qt5/qtwidgets.pas index eef053d218..6cc88fa56d 100644 --- a/lcl/interfaces/qt5/qtwidgets.pas +++ b/lcl/interfaces/qt5/qtwidgets.pas @@ -3577,6 +3577,16 @@ begin {TODO: check what happens if pure form is transparent for mouse events.} QCoreApplication_sendEvent(AWidgetAt, ANewEvent); QEvent_destroy(ANewEvent); + {if our transparent widget is hidden during mouse down, send mouse up to current + widget} + if not QWidget_isVisible(QWidgetH(Sender)) and (QEvent_type(Event)=QEventMouseButtonPress) then + begin + ANewEvent := QMouseEvent_create(QEventMouseButtonRelease, @APosF, + @AGlobalPosF, QMouseEvent_button(AMouseEvent), + QMouseEvent_buttons(AMouseEvent), QInputEvent_modifiers(QInputEventH(Event))); + QCoreApplication_sendEvent(AWidgetAt, ANewEvent); + QEvent_destroy(ANewEvent); + end; exit; end;