how to use QScroller::grabGesture in multiple scrollareas
Unsolved
General and Desktop
-
Re: how to use QScroller::grabGesture(ui->scrollArea in one or more scrollarea ?)
If four buttons are clicked separately, all four scrollareas should scroll individually, and each scrollarea should scroll for each button.
how to set the function,
void MainWindow::SetupScroller(QScrollArea *area) { QScroller::grabGesture(area->viewport(), QScroller::LeftMouseButtonGesture); QVariant OvershootPolicy = QVariant::fromValue<QScrollerProperties::OvershootPolicy> (QScrollerProperties::OvershootAlwaysOff); QScrollerProperties ScrollerProperties = QScroller::scroller(area->viewport())->scrollerProperties(); ScrollerProperties.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, OvershootPolicy); ScrollerProperties.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, OvershootPolicy); QScroller::scroller(area->viewport())->setScrollerProperties(ScrollerProperties); } .... SetupScroller(ui->scrollArea3); SetupScroller(ui->scrollArea_2)
i have use the function but the function doesn't work properly , this function scrolling one scroll area only , others are doesnot work