smooth_scroll

Module Contents

SmoothScroll

Scroll smoothly

SmoothMode

Smooth mode

SmoothScrollEngineBase

FixedStepSmoothScrollEngine

Scroll smoothly (fixed step)

AdaptiveSmoothScrollEngine

Scroll smoothly (time-based, adaptive, HiDPI friendly)

class SmoothScroll(widget: PyQt5.QtWidgets.QScrollArea, orient=Qt.Vertical, dynamicEngineEnabled=True)

Scroll smoothly

widget
orient
dynamicEngineEnabled = True
widthThreshold = 2560
smoothMode
fixedStepScrollEngine
adaptiveScrollEngine
setDynamicEngineEnabled(isEnabled: bool)

set whether to use dynamic engine

setSmoothMode(smoothMode)

set smooth mode

wheelEvent(e)
class SmoothMode

Bases: enum.Enum

Smooth mode

NO_SMOOTH = 0
CONSTANT = 1
LINEAR = 2
QUADRATI = 3
COSINE = 4
class SmoothScrollEngineBase(widget: PyQt5.QtWidgets.QScrollArea, orient=Qt.Vertical)

Bases: PyQt5.QtCore.QObject

widget
orient
fps = 60
duration = 400
stepsTotal = 0
stepRatio = 1.5
acceleration = 1
lastWheelEvent = None
scrollStamps
stepsLeftQueue
smoothMoveTimer
smoothMode
setSmoothMode(smoothMode)

set smooth mode

abstract wheelEvent(e: PyQt5.QtGui.QWheelEvent, delta: int)
sendScrollEventToScrollBar(totalDelta)
class FixedStepSmoothScrollEngine(widget: PyQt5.QtWidgets.QScrollArea, orient=Qt.Vertical)

Bases: SmoothScrollEngineBase

Scroll smoothly (fixed step)

wheelEvent(e: PyQt5.QtGui.QWheelEvent, delta: int)
class AdaptiveSmoothScrollEngine(widget: PyQt5.QtWidgets.QScrollArea, orient=Qt.Vertical)

Bases: SmoothScrollEngineBase

Scroll smoothly (time-based, adaptive, HiDPI friendly)

elapsedTimer
maxQueueSize = 3
minDuration = 120
setSmoothMode(smoothMode)

set smooth mode

wheelEvent(e, delta: int)