mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 04:38:13 +02:00
Qt: fixed scrollbar bug when tracking is off (cannot move scrollbar by mouse) - noted in #15622.
removed message sending from TQtAbstractScrollbar.slotSliderMoved() git-svn-id: trunk@24060 -
This commit is contained in:
parent
0853e3b5ca
commit
096352ee6e
@ -313,7 +313,6 @@ type
|
||||
public
|
||||
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
|
||||
procedure AttachEvents; override;
|
||||
procedure SlotSliderReleased; cdecl; override;
|
||||
end;
|
||||
|
||||
{ TQtFrame }
|
||||
@ -5243,30 +5242,14 @@ begin
|
||||
end;
|
||||
|
||||
procedure TQtAbstractSlider.SlotSliderMoved(p1: Integer); cdecl;
|
||||
var
|
||||
LMScroll: TLMScroll;
|
||||
begin
|
||||
{$ifdef VerboseQt}
|
||||
writeln('TQtAbstractSlider.sliderMoved() to pos=',p1);
|
||||
{$endif}
|
||||
|
||||
if getTracking then
|
||||
exit;
|
||||
|
||||
FillChar(LMScroll, SizeOf(LMScroll), #0);
|
||||
|
||||
LMScroll.ScrollBar := PtrUInt(Self);
|
||||
|
||||
if QAbstractSlider_orientation(QAbstractSliderH(Widget)) = QtHorizontal then
|
||||
LMScroll.Msg := LM_HSCROLL
|
||||
else
|
||||
LMScroll.Msg := LM_VSCROLL;
|
||||
|
||||
LMScroll.Pos := p1;
|
||||
LMScroll.ScrollCode := SIF_TRACKPOS;
|
||||
|
||||
if not InUpdate then
|
||||
DeliverMessage(LMScroll);
|
||||
// there's no need to deliver this message
|
||||
// since ValueChanged does it's job correct, also for tracking on/off
|
||||
// this signal must stay empty because of ttrackbar !
|
||||
end;
|
||||
|
||||
procedure TQtAbstractSlider.SlotSliderPressed; cdecl;
|
||||
@ -5300,9 +5283,6 @@ begin
|
||||
writeln('TQtAbstractSlider.SlotValueChanged() to value ',p1,' inUpdate ',inUpdate);
|
||||
{$endif}
|
||||
|
||||
if not getTracking then
|
||||
exit;
|
||||
|
||||
FillChar(LMScroll, SizeOf(LMScroll), #0);
|
||||
|
||||
LMScroll.ScrollBar := PtrUInt(Self);
|
||||
@ -5400,8 +5380,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
if not InUpdate then
|
||||
DeliverMessage(LMScroll);
|
||||
DeliverMessage(LMScroll);
|
||||
end;
|
||||
|
||||
{ TQtScrollBar }
|
||||
@ -5462,27 +5441,6 @@ begin
|
||||
QAbstractSlider_hook_hook_actionTriggered(FActionTriggeredHook, @SlotActionTriggered);
|
||||
end;
|
||||
|
||||
procedure TQtScrollBar.SlotSliderReleased; cdecl;
|
||||
var
|
||||
LMScroll: TLMScroll;
|
||||
begin
|
||||
inherited SlotSliderReleased;
|
||||
FillChar(LMScroll, SizeOf(LMScroll), #0);
|
||||
|
||||
LMScroll.ScrollBar := PtrUInt(Self);
|
||||
|
||||
if QAbstractSlider_orientation(QAbstractSliderH(Widget)) = QtHorizontal then
|
||||
LMScroll.Msg := LM_HSCROLL
|
||||
else
|
||||
LMScroll.Msg := LM_VSCROLL;
|
||||
|
||||
LMScroll.Pos := getSliderPosition;
|
||||
LMScroll.ScrollCode := SIF_POS;
|
||||
|
||||
if not InUpdate then
|
||||
DeliverMessage(LMScroll);
|
||||
end;
|
||||
|
||||
{ TQtToolBar }
|
||||
|
||||
function TQtToolBar.CreateWidget(const AParams: TCreateParams):QWidgetH;
|
||||
|
@ -327,7 +327,9 @@ begin
|
||||
QtScrollBar.setSingleStep((AScrollBar.PageSize div 6) + 1);
|
||||
QtScrollBar.setRange(AScrollBar.Min, AScrollBar.Max);
|
||||
|
||||
QtScrollBar.BeginUpdate;
|
||||
QtScrollBar.setValue(AScrollBar.Position);
|
||||
QtScrollbar.EndUpdate;
|
||||
|
||||
case AScrollBar.Kind of
|
||||
sbHorizontal:
|
||||
|
Loading…
Reference in New Issue
Block a user