Connect QListWidget-Scrollbar and Pushbutton

148 Views Asked by At

I'm looking for a Way to connect the Scrollbar of a QListWidget with a QPushbutton. So that I can use two QPushbuttons to scroll up and down. I only find the scrollToTop() and scrollToBottom() functions, but they scroll all the way and I only want them to scroll a Step, like the small Buttons on the Scrollbar.

Thanks in advance!

1

There are 1 best solutions below

0
BaronVonBullshitRidesAgain On

Ok I have found the Answer myself:

void MainView::on_button_up_clicked() {
  ui->listWidget_entries->verticalScrollBar()
    ->triggerAction(QAbstractSlider::SliderPageStepSub); 
}