mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 22:49:30 +02:00
Qt,Qt5,Qt6: initialize scroll offset when handle is created. issue #41513
(cherry picked from commit c0f4946828
)
Co-authored-by: zeljan1 <zeljko@holobit.hr>
This commit is contained in:
parent
651963c199
commit
e54a83fb6e
@ -6723,6 +6723,13 @@ begin
|
||||
inherited AttachEvents;
|
||||
FViewPortEventHook := QObject_hook_create(viewportWidget);
|
||||
QObject_hook_hook_events(FViewPortEventHook, @ScrollViewEventFilter);
|
||||
if (LCLObject is TScrollingWinControl) then
|
||||
begin
|
||||
if TScrollingWinControl(LCLObject).VertScrollBar.Visible then
|
||||
FScrollY := -TScrollingWinControl(LCLObject).VertScrollBar.Position;
|
||||
if TScrollingWinControl(LCLObject).HorzScrollBar.Visible then
|
||||
FScrollX := -TScrollingWinControl(LCLObject).HorzScrollBar.Position;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TQtWindowArea.CanAdjustClientRectOnResize: Boolean;
|
||||
|
@ -7019,6 +7019,13 @@ begin
|
||||
inherited AttachEvents;
|
||||
FViewPortEventHook := QObject_hook_create(viewportWidget);
|
||||
QObject_hook_hook_events(FViewPortEventHook, @ScrollViewEventFilter);
|
||||
if (LCLObject is TScrollingWinControl) then
|
||||
begin
|
||||
if TScrollingWinControl(LCLObject).VertScrollBar.Visible then
|
||||
FScrollY := -TScrollingWinControl(LCLObject).VertScrollBar.Position;
|
||||
if TScrollingWinControl(LCLObject).HorzScrollBar.Visible then
|
||||
FScrollX := -TScrollingWinControl(LCLObject).HorzScrollBar.Position;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TQtWindowArea.CanAdjustClientRectOnResize: Boolean;
|
||||
|
@ -6968,6 +6968,13 @@ begin
|
||||
inherited AttachEvents;
|
||||
FViewPortEventHook := QObject_hook_create(viewportWidget);
|
||||
QObject_hook_hook_events(FViewPortEventHook, @ScrollViewEventFilter);
|
||||
if (LCLObject is TScrollingWinControl) then
|
||||
begin
|
||||
if TScrollingWinControl(LCLObject).VertScrollBar.Visible then
|
||||
FScrollY := -TScrollingWinControl(LCLObject).VertScrollBar.Position;
|
||||
if TScrollingWinControl(LCLObject).HorzScrollBar.Visible then
|
||||
FScrollX := -TScrollingWinControl(LCLObject).HorzScrollBar.Position;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TQtWindowArea.CanAdjustClientRectOnResize: Boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user