MCPcopy Create free account
hub / github.com/YACReader/yacreader / animateScroll

Method animateScroll

YACReader/viewer.cpp:745–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743}
744
745void Viewer::animateScroll(QPropertyAnimation &scroller, const QScrollBar &scrollBar, int delta)
746{
747 int deltaNotFinished = 0;
748 if (scroller.state() == QAbstractAnimation::Running) {
749 deltaNotFinished = scroller.startValue().toInt() - scroller.endValue().toInt();
750 scroller.stop();
751 }
752
753 const int currentPos = scrollBar.sliderPosition();
754 scroller.setDuration(animationDuration());
755 scroller.setStartValue(currentPos);
756 scroller.setEndValue(currentPos - delta - deltaNotFinished);
757
758 scroller.start();
759}
760
761void Viewer::wheelEvent(QWheelEvent *event)
762{

Callers

nothing calls this directly

Calls 3

stateMethod · 0.80
startMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected