mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 15:10:22 +02:00
qt: fix getClientBounds return (left, top was always zero) - part of 0011020
git-svn-id: trunk@14711 -
This commit is contained in:
parent
86f7687fe9
commit
18edbe16d8
@ -2508,8 +2508,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtWidget.getClientBounds: TRect;
|
function TQtWidget.getClientBounds: TRect;
|
||||||
|
var
|
||||||
|
parent: QWidgetH;
|
||||||
|
Pt: TQtPoint;
|
||||||
begin
|
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;
|
end;
|
||||||
|
|
||||||
procedure TQtWidget.grabMouse;
|
procedure TQtWidget.grabMouse;
|
||||||
|
Loading…
Reference in New Issue
Block a user