Qt: Fetch OverlayScrollBar sliderPosition from the real ScrollBar

In OverlayScrollBar return the real ScrollBar sliderPosition to ensure
the correct value is used when handling the actionTriggered signal in
vScrollBarActionTriggered().

This improves turning on and off auto scroll during capture when page
stepping using the packet list slider, because the value is propagated
after this signal.


(cherry picked from commit 7980f25f99)
This commit is contained in:
Stig Bjørlykke 2021-01-03 13:56:43 +00:00
parent c57c306762
commit ee43965024
3 changed files with 7 additions and 1 deletions

View File

@ -1830,7 +1830,7 @@ void PacketList::vScrollBarActionTriggered(int)
{
// If we're scrolling with a mouse wheel or trackpad sliderPosition can end up
// past the end.
tail_at_end_ = (verticalScrollBar()->sliderPosition() >= verticalScrollBar()->maximum());
tail_at_end_ = (overlay_sb_->sliderPosition() >= overlay_sb_->maximum());
scrollViewChanged(tail_at_end_);
}

View File

@ -94,6 +94,11 @@ QSize OverlayScrollBar::sizeHint() const
QScrollBar::sizeHint().height());
}
int OverlayScrollBar::sliderPosition()
{
return child_sb_.sliderPosition();
}
void OverlayScrollBar::setNearOverlayImage(QImage &overlay_image, int packet_count, int start_pos, int end_pos, QList<int> positions)
{
int old_width = packet_map_img_.width();

View File

@ -22,6 +22,7 @@ public:
virtual ~OverlayScrollBar();
virtual QSize sizeHint() const;
virtual int sliderPosition();
/** Set the "near" overlay image.
* @param overlay_image An image containing a 1:1 mapping of nearby