Assuming you have access to the QScrollBar you want to move, you can do it like this: Use a single-shot QTimer to define how often you move the scroll. Connect the timeout()
signal of the timer to a slot written by you which calls the QScrollBar setSliderPosition
method. If you need to scroll further, restart the QTimer.
The slot you connect the timer's signal to would look like:
void scroll()
{
new_scroll_offset = ...; // compute scroll offset here (possibly from old scroll offset)
scroll_bar->setSliderPosition(new_scroll_offset);
if (/* can scroll further */)
{
timer->start();
}
}
It can also be done with a multiple shot timer in a similar fashion