diff --git a/lcl/interfaces/qt/qtdefines.inc b/lcl/interfaces/qt/qtdefines.inc index 19c0519a5f..bbc36a4b09 100644 --- a/lcl/interfaces/qt/qtdefines.inc +++ b/lcl/interfaces/qt/qtdefines.inc @@ -9,7 +9,8 @@ {$DEFINE QTCOCOA} {$ENDIF} {$DEFINE QTSCROLLABLEFORMS} - {$DEFINE QtUseNativeEventLoop} + {removed usage of nativeeventloop because of issue #34982} + {.$DEFINE QtUseNativeEventLoop} {$IFDEF DARWIN} {enable this define if you have problems when dialogs are shown behind application} {.$DEFINE TQTMESSAGEBOXUSEPARENT} diff --git a/lcl/interfaces/qt/qtwsforms.pp b/lcl/interfaces/qt/qtwsforms.pp index fc922e744d..43274e02fe 100644 --- a/lcl/interfaces/qt/qtwsforms.pp +++ b/lcl/interfaces/qt/qtwsforms.pp @@ -474,6 +474,12 @@ begin ACustomForm := TCustomForm(AWinControl); Widget := TQtMainWindow(AWinControl.Handle); + {$IFNDEF QtUseNativeEventLoop} + {issue #34982} + if AWinControl.HandleObjectShouldBeVisible and Application.Terminated then + exit; + {$ENDIF} + if AWinControl.HandleObjectShouldBeVisible then begin if fsModal in ACustomForm.FormState then diff --git a/lcl/interfaces/qt5/qtwsforms.pp b/lcl/interfaces/qt5/qtwsforms.pp index 1ad47f1c4c..bc8b858ce3 100644 --- a/lcl/interfaces/qt5/qtwsforms.pp +++ b/lcl/interfaces/qt5/qtwsforms.pp @@ -479,6 +479,13 @@ begin Widget := TQtMainWindow(AWinControl.Handle); + + {$IFNDEF QtUseNativeEventLoop} + {issue #34982} + if AWinControl.HandleObjectShouldBeVisible and Application.Terminated then + exit; + {$ENDIF} + if AWinControl.HandleObjectShouldBeVisible then begin if fsModal in TForm(AWinControl).FormState then