From a3e431c4149e8a90437b29cbfbf9b8285dd182d1 Mon Sep 17 00:00:00 2001 From: zeljko Date: Tue, 21 Oct 2014 07:26:39 +0000 Subject: [PATCH] Qt: workaround for qt bug with mdichild activation after changes in r46623 #7633a0c2ba. git-svn-id: trunk@46629 - --- lcl/interfaces/qt/qtwidgets.pas | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index 4c13115e3b..7145b909aa 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -6853,6 +6853,23 @@ begin BeginEventProcessing; try case QEvent_type(Event) of + QEventHide: + begin + Result := inherited EventFilter(Sender, Event); + {as of r46623 (issue #26893) we use QObject_deleteLater + instead of QWidget_destroy. + QMDIArea does not respond after that, so we must activate next mdichild + according to mdi standards.Looks like Qt4 bug.} + if not Application.Terminated and IsMDIChild then + begin + if Assigned(MDIChildArea) then + begin + if (MDIChildArea.ActiveSubWindow = nil) or + (MDIChildArea.ActiveSubWindow = Widget) then + QMdiArea_activatePreviousSubWindow(QMDIAreaH(MDIChildArea.Widget)); + end; + end; + end; QEventMouseButtonPress, QEventMouseButtonRelease, QEventMouseButtonDblClick: