qt: fix getClientBounds return (left, top was always zero) - part of 0011020

git-svn-id: trunk@14711 -
This commit is contained in:
paul 2008-04-01 09:14:35 +00:00
parent 86f7687fe9
commit 18edbe16d8

View File

@ -2508,8 +2508,18 @@ begin
end;
function TQtWidget.getClientBounds: TRect;
var
parent: QWidgetH;
Pt: TQtPoint;
begin
QWidget_contentsRect(Widget, @Result);
QWidget_contentsRect(Widget, @Result); // returns with zero offset
parent := QWidget_parentWidget(Widget); // get offset from parent
if (parent <> nil) and (Result.Left = 0) and (Result.Top = 0) then
begin
Pt := QtPoint(0, 0);
QWidget_mapToParent(Widget, @Pt, @Pt);
OffsetRect(Result, Pt.x, Pt.y);
end;
end;
procedure TQtWidget.grabMouse;