Qt5,Qt6: fix GetWindowSize regression. issue #41575

(cherry picked from commit dadc0e93e2)

Co-authored-by: zeljan1 <zeljko@holobit.hr>
This commit is contained in:
Željan Rikalo 2025-04-08 08:01:34 +02:00 committed by Željan Rikalo
parent e54a83fb6e
commit 08e7c91f0c
2 changed files with 12 additions and 0 deletions

View File

@ -4440,6 +4440,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

@ -4450,6 +4450,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;