diff --git a/lcl/interfaces/qt/qtobject.inc b/lcl/interfaces/qt/qtobject.inc index 428b00baa9..ba3c00a9e5 100644 --- a/lcl/interfaces/qt/qtobject.inc +++ b/lcl/interfaces/qt/qtobject.inc @@ -360,8 +360,9 @@ begin AForm := Screen.CustomFormsZOrdered[i]; if (AForm.Parent=nil) and AForm.HandleAllocated and TQtWidget(AForm.Handle).getVisible and - not (AForm.FormStyle in [fsMDIChild, fsSplash]) and - not (AForm.BorderStyle in [bsNone]) then + ((not (AForm.FormStyle in [fsMDIChild, fsSplash]) and + not (AForm.BorderStyle = bsNone)) or + (csDesigning in AForm.ComponentState)) then begin States := TQtMainWindow(AForm.Handle).getWindowState; if not TQtMainWindow(AForm.Handle).isMinimized then @@ -391,8 +392,9 @@ begin AForm := Screen.CustomFormsZOrdered[i]; if (AForm.Parent=nil) and AForm.HandleAllocated and TQtWidget(AForm.Handle).getVisible and - not (AForm.FormStyle in [fsMDIChild, fsSplash]) and - not (AForm.BorderStyle in [bsNone]) then + ((not (AForm.FormStyle in [fsMDIChild, fsSplash]) and + not (AForm.BorderStyle = bsNone)) or + (csDesigning in AForm.ComponentState)) then begin States := TQtMainWindow(AForm.Handle).getWindowState; if TQtMainWindow(AForm.Handle).isMinimized then diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index d69599ec46..36edb3709e 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -3945,7 +3945,8 @@ begin {$IFDEF HASX11} if (LCLObject is TCustomForm) and EqualRect(FrameRect, WindowRect) and (TCustomForm(LCLObject).BorderStyle <> bsNone) and - not (TCustomForm(LCLObject).FormStyle in [fsMDIChild,fsSplash]) then + (not (TCustomForm(LCLObject).FormStyle in [fsMDIChild,fsSplash]) or + (csDesigning in LCLObject.ComponentState)) then begin ACurrPos := getPos; // do not send garbage to LCL. This window isn't decorated yet by WM. diff --git a/lcl/interfaces/qt/qtwsforms.pp b/lcl/interfaces/qt/qtwsforms.pp index 5d2cd7ba38..1de20c2ac7 100644 --- a/lcl/interfaces/qt/qtwsforms.pp +++ b/lcl/interfaces/qt/qtwsforms.pp @@ -194,7 +194,7 @@ begin AForm.BorderIcons, AForm.FormStyle); end; - if not (AForm.FormStyle in [fsMDIChild]) and + if (not (AForm.FormStyle in [fsMDIChild]) or (csDesigning in AForm.ComponentState)) and (Application <> nil) and (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) and @@ -203,14 +203,16 @@ begin if (AForm.ShowInTaskBar in [stDefault, stNever]) {$ifdef HASX11} {QtTool have not minimize button !} - and not (AForm.BorderStyle in [bsSizeToolWin, bsToolWindow]) + and (not (AForm.BorderStyle in [bsSizeToolWin, bsToolWindow]) or + (csDesigning in AForm.ComponentState)) {$endif} then QtMainWindow.setShowInTaskBar(False); if Assigned(AForm.PopupParent) then PopupParent := TQtWidget(AForm.PopupParent.Handle).Widget else PopupParent := nil; - QtMainWindow.setPopupParent(AForm.PopupMode, PopupParent); + if not (csDesigning in AForm.ComponentState) then + QtMainWindow.setPopupParent(AForm.PopupMode, PopupParent); end; {$IFDEF HASX11} @@ -226,9 +228,9 @@ begin {$ENDIF} QtMainWindow.MenuBar.AttachEvents; - if (AForm.FormStyle in [fsMDIChild]) and - (Application.MainForm.FormStyle = fsMdiForm) and - not (csDesigning in AWinControl.ComponentState) then + if not (csDesigning in AForm.ComponentState) and + (AForm.FormStyle in [fsMDIChild]) and + (Application.MainForm.FormStyle = fsMdiForm) then begin QMdiArea_addSubWindow( QMdiAreaH(TQtMainWindow(Application.MainForm.Handle).MDIAreaHandle.Widget), @@ -377,7 +379,7 @@ begin (Application.MainForm <> AForm) then Enable := false; {$IFDEF HASX11} - if AForm.FormStyle <> fsMDIChild then + if (AForm.FormStyle <> fsMDIChild) then SetSkipX11Taskbar(TQtMainWindow(AForm.Handle).Widget, not Enable); {$ENDIF} TQtMainWindow(AForm.Handle).setShowInTaskBar(Enable); @@ -505,7 +507,8 @@ begin end; end; - if TForm(AWinControl).FormStyle <> fsMDIChild then + if (TForm(AWinControl).FormStyle <> fsMDIChild) or + (csDesigning in AWinControl.ComponentState) then begin if (csDesigning in AWinControl.ComponentState) and (TCustomForm(AWinControl).WindowState = wsMaximized) then