Qt5,Qt6: fix GetWindowSize regression. issue #41575

This commit is contained in:
zeljan1 2025-04-07 21:14:11 +02:00
parent cc809e40b9
commit dadc0e93e2
2 changed files with 12 additions and 0 deletions

View File

@ -4476,6 +4476,12 @@ begin
GetClientRect(Handle, ARect);
Width := ARect.Width;
Height := ARect.Height;
{$IFDEF QTSCROLLABLEFORMS}
if TQtMainWindow(Handle).ScrollArea.verticalScrollBar.getVisible then
inc(Height, TQtMainWindow(Handle).ScrollArea.verticalScrollBar.getWidth);
if TQtMainWindow(Handle).ScrollArea.horizontalScrollBar.getVisible then
inc(Width, TQtMainWindow(Handle).ScrollArea.horizontalScrollBar.getHeight);
{$ENDIF}
end else
begin
ASize := TQtWidget(Handle).getSize;

View File

@ -4504,6 +4504,12 @@ begin
GetClientRect(Handle, ARect);
Width := ARect.Width;
Height := ARect.Height;
{$IFDEF QTSCROLLABLEFORMS}
if TQtMainWindow(Handle).ScrollArea.verticalScrollBar.getVisible then
inc(Height, TQtMainWindow(Handle).ScrollArea.verticalScrollBar.getWidth);
if TQtMainWindow(Handle).ScrollArea.horizontalScrollBar.getVisible then
inc(Width, TQtMainWindow(Handle).ScrollArea.horizontalScrollBar.getHeight);
{$ENDIF}
end else
begin
ASize := TQtWidget(Handle).getSize;