Set QScrollerProperties::OvershootPolicy not working ?
-
I'm trying to change the OvershootPolicy of QScroller with the following code:
@
QScroller::grabGesture( m_scrollArea->viewport(), QScroller::LeftMouseButtonGesture );
QScroller* qs = QScroller::scroller( m_scrollArea->viewport() );QScrollerProperties sp = qs->scrollerProperties();
sp.setScrollMetric( QScrollerProperties::HorizontalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff );
sp.setScrollMetric( QScrollerProperties::VerticalOvershootPolicy, QScrollerProperties::OvershootAlwaysOff );qs->setScrollerProperties( sp );
@But it seems to have no effect. There is still overshooting from the borders. Am I missing something?
-
need QVariant cast.
QScrollerProperties properties = QScroller::scroller(scrollWidget)->scrollerProperties(); QVariant overshootPolicy = QVariant::fromValue<QScrollerProperties::OvershootPolicy>(QScrollerProperties::OvershootAlwaysOff); properties.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, overshootPolicy); QScroller::scroller(scrollWidget)->setScrollerProperties(properties);