Qt5,Qt6: fixes sizepos loop error. issue #41508

This commit is contained in:
zeljan1 2025-04-01 21:37:09 +02:00
parent 1fb8e5a099
commit a7c6c82c2b
2 changed files with 14 additions and 2 deletions

View File

@ -4440,7 +4440,13 @@ begin
{$endif}
if Handle = 0 then
Exit(False);
R := TQtWidget(Handle).getFrameGeometry;
if QWidget_isTopLevel(TQtWidget(Handle).Widget) then
begin
R := Rect(0, 0, 0, 0);
if GetWindowRect(Handle, R) = 0 then
R := TQtWidget(Handle).getFrameGeometry;
end else
R := TQtWidget(Handle).getFrameGeometry;
Left := R.Left;
Top := R.Top;
Result := True;

View File

@ -4467,7 +4467,13 @@ begin
{$endif}
if Handle = 0 then
Exit(False);
R := TQtWidget(Handle).getFrameGeometry;
if QWidget_isTopLevel(TQtWidget(Handle).Widget) then
begin
R := Rect(0, 0, 0, 0);
if GetWindowRect(Handle, R) = 0 then
R := TQtWidget(Handle).getFrameGeometry;
end else
R := TQtWidget(Handle).getFrameGeometry;
Left := R.Left;
Top := R.Top;
Result := True;