From 34f3fbbdfcad4bb9e9a0ab6254006968a295fb8b Mon Sep 17 00:00:00 2001 From: zeljko Date: Fri, 8 Apr 2016 11:34:07 +0000 Subject: [PATCH] Qt: small optimisation when calculating mdiform area geometry. git-svn-id: trunk@52149 - --- lcl/interfaces/qt/qtwidgets.pas | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lcl/interfaces/qt/qtwidgets.pas b/lcl/interfaces/qt/qtwidgets.pas index ed928a73b5..7edc38d8d5 100644 --- a/lcl/interfaces/qt/qtwidgets.pas +++ b/lcl/interfaces/qt/qtwidgets.pas @@ -8057,14 +8057,13 @@ begin {first must get contents rect - all except main menu} QWidget_contentsRect(FCentralWidget, @R); {TODO: find better way to find out which controls are top,left,right & bottom aligned ...} - for i := 0 to LCLObject.ComponentCount - 1 do + for i := 0 to LCLObject.ControlCount - 1 do begin - if (LCLObject.Components[i] is TWinControl) and - (TWinControl(LCLObject.Components[i]).Parent = LCLObject) and - (TWinControl(LCLObject.Components[i]).Align in [alTop, alLeft, alRight, alBottom]) then + if (LCLObject.Controls[i] is TWinControl) and + (TWinControl(LCLObject.Controls[i]).Align in [alTop, alLeft, alRight, alBottom]) then begin - R2 := TWinControl(LCLObject.Components[i]).BoundsRect; - case TWinControl(LCLObject.Components[i]).Align of + R2 := TWinControl(LCLObject.Controls[i]).BoundsRect; + case TWinControl(LCLObject.Controls[i]).Align of alLeft: R.Left := R.Left + (R2.Right - R2.Left); alTop: R.Top := R.Top + (R2.Bottom - R2.Top); alRight: R.Right := R.Right - (R2.Right - R2.Left);