diff --git a/lcl/interfaces/qt/qtwsforms.pp b/lcl/interfaces/qt/qtwsforms.pp index ea9f4fd56f..1c69938867 100644 --- a/lcl/interfaces/qt/qtwsforms.pp +++ b/lcl/interfaces/qt/qtwsforms.pp @@ -616,6 +616,12 @@ begin end; {$ENDIF} end; + + // issue #39158 + if AWinControl.HandleObjectShouldBeVisible and + (TCustomForm(AWinControl).BorderStyle = bsNone) and + not Widget.IsMdiChild then + ConstraintsChange(AWinControl); end; Widget.setVisible(AWinControl.HandleObjectShouldBeVisible); diff --git a/lcl/interfaces/qt5/qtwsforms.pp b/lcl/interfaces/qt5/qtwsforms.pp index 6fa0d51218..0748434656 100644 --- a/lcl/interfaces/qt5/qtwsforms.pp +++ b/lcl/interfaces/qt5/qtwsforms.pp @@ -637,6 +637,12 @@ begin end; {$ENDIF} end; + + // issue #39158 + if AWinControl.HandleObjectShouldBeVisible and + (TCustomForm(AWinControl).BorderStyle = bsNone) and + not Widget.IsMdiChild then + ConstraintsChange(AWinControl); end; Widget.setVisible(AWinControl.HandleObjectShouldBeVisible);