mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 09:19:17 +02:00
Qt: avoid crash in TQtAbstractSlider.SlotValueChanged() because of update in SetScrollInfo()
git-svn-id: trunk@22063 -
This commit is contained in:
parent
04304dd66c
commit
49c3771c08
@ -5061,8 +5061,8 @@ var
|
||||
LMScroll: TLMScroll;
|
||||
begin
|
||||
{$ifdef VerboseQt}
|
||||
writeln('TQtAbstractSlider.SlotValueChanged() to value ',p1);
|
||||
{$endif}
|
||||
writeln('TQtAbstractSlider.SlotValueChanged() to value ',p1,' inUpdate ',inUpdate);
|
||||
{$endif}
|
||||
|
||||
FillChar(LMScroll, SizeOf(LMScroll), #0);
|
||||
|
||||
@ -5076,7 +5076,7 @@ begin
|
||||
LMScroll.Pos := p1;
|
||||
LMScroll.ScrollCode := SIF_POS;
|
||||
|
||||
if not SliderPressed then
|
||||
if not SliderPressed and not InUpdate then
|
||||
DeliverMessage(LMScroll);
|
||||
end;
|
||||
|
||||
|
@ -4656,14 +4656,19 @@ var
|
||||
|
||||
if (ScrollInfo.FMask and SIF_POS) <> 0 then
|
||||
begin
|
||||
if (ScrollInfo.nPos < ScrollBar.getMin) then
|
||||
ScrollInfo.nPos := ScrollBar.getMin
|
||||
else
|
||||
if (ScrollInfo.nPos > ScrollBar.getMax) then
|
||||
ScrollInfo.nPos := ScrollBar.getMax;
|
||||
ScrollBar.BeginUpdate;
|
||||
try
|
||||
if (ScrollInfo.nPos < ScrollBar.getMin) then
|
||||
ScrollInfo.nPos := ScrollBar.getMin
|
||||
else
|
||||
if (ScrollInfo.nPos > ScrollBar.getMax) then
|
||||
ScrollInfo.nPos := ScrollBar.getMax;
|
||||
|
||||
if (ScrollInfo.FMask and SIF_UPDATEPOLICY) = 0 then
|
||||
ScrollBar.setValue(ScrollInfo.nPos);
|
||||
if (ScrollInfo.FMask and SIF_UPDATEPOLICY) = 0 then
|
||||
ScrollBar.setValue(ScrollInfo.nPos);
|
||||
finally
|
||||
ScrollBar.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
if (ScrollInfo.FMask and SIF_TRACKPOS) <> 0 then
|
||||
|
Loading…
Reference in New Issue
Block a user