From d2c1b2ccabbc8ac0ce2fc9f6400b09fd31c7e185 Mon Sep 17 00:00:00 2001 From: zeljko Date: Mon, 23 Jul 2007 18:25:09 +0000 Subject: [PATCH] *Fixed MDI window sizes and child controls alignment. git-svn-id: trunk@11604 - --- lcl/interfaces/qt/qtwscontrols.pp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lcl/interfaces/qt/qtwscontrols.pp b/lcl/interfaces/qt/qtwscontrols.pp index 4f08af3480..a5469e04d9 100644 --- a/lcl/interfaces/qt/qtwscontrols.pp +++ b/lcl/interfaces/qt/qtwscontrols.pp @@ -35,7 +35,7 @@ uses {$endif} qtwidgets, qtobjects, // LCL - SysUtils, Controls, LCLType, LCLProc, Forms, Graphics, + SysUtils, Classes, Controls, LCLType, LCLProc, Forms, Graphics, // Widgetset InterfaceBase, WSControls, WSLCLClasses; @@ -163,6 +163,7 @@ end; class procedure TQtWSCustomControl.ShowHide(const AWinControl: TWinControl); var Widget: TQtWidget; + R: TRect; begin {$ifdef VerboseQt} WriteLn('Trace:> [TQtWSCustomControl.ShowHide]'); @@ -186,8 +187,12 @@ begin if TForm(AWinControl).FormStyle = fsMDIChild then begin - TForm(AWinControl).Left := 0; - TForm(AWinControl).Top := 0; + {MDI windows have to be resized , since titlebar is included into widget geometry !} + QWidget_contentsRect(Widget.Widget, @R); + TForm(AWinControl).Left := 0; + TForm(AWinControl).Top := 0; + TForm(AWinControl).Width := TForm(AWinControl).Width + R.Left; + TForm(AWinControl).Height := TForm(AWinControl).Height + R.Top; TForm(AWinControl).ReAlign; end; end;