mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 04:09:20 +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;
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user