smooth_scroll ============= .. py:module:: qfluentwidgets.common.smooth_scroll Module Contents --------------- .. autoapisummary:: qfluentwidgets.common.smooth_scroll.SmoothScroll qfluentwidgets.common.smooth_scroll.SmoothMode qfluentwidgets.common.smooth_scroll.SmoothScrollEngineBase qfluentwidgets.common.smooth_scroll.FixedStepSmoothScrollEngine qfluentwidgets.common.smooth_scroll.AdaptiveSmoothScrollEngine .. py:class:: SmoothScroll(widget: PyQt5.QtWidgets.QScrollArea, orient=Qt.Vertical, dynamicEngineEnabled=True) Scroll smoothly .. py:attribute:: widget .. py:attribute:: orient .. py:attribute:: dynamicEngineEnabled :value: True .. py:attribute:: widthThreshold :value: 2560 .. py:attribute:: smoothMode .. py:attribute:: fixedStepScrollEngine .. py:attribute:: adaptiveScrollEngine .. py:method:: setDynamicEngineEnabled(isEnabled: bool) set whether to use dynamic engine .. py:method:: setSmoothMode(smoothMode) set smooth mode .. py:method:: wheelEvent(e) .. py:class:: SmoothMode Bases: :py:obj:`enum.Enum` Smooth mode .. py:attribute:: NO_SMOOTH :value: 0 .. py:attribute:: CONSTANT :value: 1 .. py:attribute:: LINEAR :value: 2 .. py:attribute:: QUADRATI :value: 3 .. py:attribute:: COSINE :value: 4 .. py:class:: SmoothScrollEngineBase(widget: PyQt5.QtWidgets.QScrollArea, orient=Qt.Vertical) Bases: :py:obj:`PyQt5.QtCore.QObject` .. py:attribute:: widget .. py:attribute:: orient .. py:attribute:: fps :value: 60 .. py:attribute:: duration :value: 400 .. py:attribute:: stepsTotal :value: 0 .. py:attribute:: stepRatio :value: 1.5 .. py:attribute:: acceleration :value: 1 .. py:attribute:: lastWheelEvent :value: None .. py:attribute:: scrollStamps .. py:attribute:: stepsLeftQueue .. py:attribute:: smoothMoveTimer .. py:attribute:: smoothMode .. py:method:: setSmoothMode(smoothMode) set smooth mode .. py:method:: wheelEvent(e: PyQt5.QtGui.QWheelEvent, delta: int) :abstractmethod: .. py:method:: sendScrollEventToScrollBar(totalDelta) .. py:class:: FixedStepSmoothScrollEngine(widget: PyQt5.QtWidgets.QScrollArea, orient=Qt.Vertical) Bases: :py:obj:`SmoothScrollEngineBase` Scroll smoothly (fixed step) .. py:method:: wheelEvent(e: PyQt5.QtGui.QWheelEvent, delta: int) .. py:class:: AdaptiveSmoothScrollEngine(widget: PyQt5.QtWidgets.QScrollArea, orient=Qt.Vertical) Bases: :py:obj:`SmoothScrollEngineBase` Scroll smoothly (time-based, adaptive, HiDPI friendly) .. py:attribute:: elapsedTimer .. py:attribute:: maxQueueSize :value: 3 .. py:attribute:: minDuration :value: 120 .. py:method:: setSmoothMode(smoothMode) set smooth mode .. py:method:: wheelEvent(e, delta: int)