181 Q_INTERFACES(QQmlParserStatus)
187 Q_PROPERTY(QQuickItem* target READ target WRITE setTarget NOTIFY targetChanged FINAL)
189 Q_PROPERTY(
bool active READ active WRITE setActive NOTIFY activeChanged FINAL)
201 Q_PROPERTY(qreal verticalStepSize READ verticalStepSize WRITE setVerticalStepSize RESET
202 resetVerticalStepSize NOTIFY verticalStepSizeChanged FINAL)
214 Q_PROPERTY(qreal horizontalStepSize READ horizontalStepSize WRITE setHorizontalStepSize RESET
215 resetHorizontalStepSize NOTIFY horizontalStepSizeChanged FINAL)
225 Q_PROPERTY(Qt::KeyboardModifiers pageScrollModifiers READ pageScrollModifiers WRITE
226 setPageScrollModifiers RESET resetPageScrollModifiers NOTIFY
227 pageScrollModifiersChanged FINAL)
244 Q_PROPERTY(
bool filterMouseEvents READ filterMouseEvents WRITE setFilterMouseEvents NOTIFY
245 filterMouseEventsChanged FINAL)
264 Q_PROPERTY(
bool keyNavigationEnabled READ keyNavigationEnabled WRITE setKeyNavigationEnabled
265 NOTIFY keyNavigationEnabledChanged FINAL)
280 Q_PROPERTY(
bool blockTargetWheel MEMBER m_blockTargetWheel NOTIFY blockTargetWheelChanged FINAL)
288 Q_PROPERTY(
bool scrollFlickableTarget MEMBER m_scrollFlickableTarget NOTIFY
289 scrollFlickableTargetChanged FINAL)
292 bool useAnimation READ useAnimation WRITE setUseAnimation NOTIFY useAnimationChanged FINAL)
298 QQuickItem* target() const;
299 void setTarget(QQuickItem* target);
301 auto active() const ->
bool;
302 void setActive(
bool);
303 qreal verticalStepSize() const;
304 void setVerticalStepSize(qreal stepSize);
305 void resetVerticalStepSize();
307 qreal horizontalStepSize() const;
308 void setHorizontalStepSize(qreal stepSize);
309 void resetHorizontalStepSize();
311 Qt::KeyboardModifiers pageScrollModifiers() const;
312 void setPageScrollModifiers(Qt::KeyboardModifiers modifiers);
313 void resetPageScrollModifiers();
315 bool filterMouseEvents() const;
316 void setFilterMouseEvents(
bool enabled);
318 bool keyNavigationEnabled() const;
319 void setKeyNavigationEnabled(
bool enabled);
321 bool useAnimation() const;
322 void setUseAnimation(
bool);
324 Q_INVOKABLE
bool scrollUp(qreal stepSize = -1);
325 Q_INVOKABLE
bool scrollDown(qreal stepSize = -1);
327 Q_INVOKABLE
bool scrollLeft(qreal stepSize = -1);
328 Q_INVOKABLE
bool scrollRight(qreal stepSize = -1);
331 void targetChanged();
332 void activeChanged();
333 void verticalStepSizeChanged();
334 void horizontalStepSizeChanged();
335 void pageScrollModifiersChanged();
336 void filterMouseEventsChanged();
337 void keyNavigationEnabledChanged();
338 void blockTargetWheelChanged();
339 void scrollFlickableTargetChanged();
340 void useAnimationChanged();
352 bool eventFilter(QObject* watched, QEvent* event) override;
355 void refreshAttach();
358 void rebindScrollBarV();
359 void rebindScrollBarH();
363 void rebindScrollBar(ScrollBar& scrollBar);
364 void classBegin() override;
365 void componentComplete() override;
367 void setScrolling(
bool scrolling);
368 bool scrollFlickable(QPointF pixelDelta, QPointF angleDelta = {},
369 Qt::KeyboardModifiers modifiers = Qt::NoModifier);
371 QPointer<QQuickItem> m_target;
374 QMetaObject::Connection m_verticalChangedConnection;
375 QMetaObject::Connection m_horizontalChangedConnection;
378 qreal m_defaultPixelStepSize = 20 * QGuiApplication::styleHints()->wheelScrollLines();
379 qreal m_verticalStepSize = m_defaultPixelStepSize;
380 qreal m_horizontalStepSize = m_defaultPixelStepSize;
381 bool m_explicitVStepSize =
false;
382 bool m_explicitHStepSize =
false;
383 bool m_wheelScrolling =
false;
384 constexpr static qreal m_wheelScrollingDuration = 400;
385 bool m_filterMouseEvents =
false;
386 bool m_keyNavigationEnabled =
false;
387 bool m_blockTargetWheel =
true;
388 bool m_scrollFlickableTarget =
true;
390 constexpr static Qt::KeyboardModifiers m_defaultHorizontalScrollModifiers = Qt::AltModifier;
392 constexpr static Qt::KeyboardModifiers m_defaultPageScrollModifiers =
393 Qt::ControlModifier | Qt::ShiftModifier;
394 Qt::KeyboardModifiers m_pageScrollModifiers = m_defaultPageScrollModifiers;
395 QTimer m_wheelScrollingTimer;
399 QQmlEngine* m_engine =
nullptr;
400 bool m_wasTouched =
false;
403 QQmlProperty originX, originY;
404 QQmlProperty leftMargin, rightMargin;
405 QQmlProperty topMargin, bottomMargin;
406 QQmlProperty contentX, contentY;
407 QQmlProperty contentHeight, contentWidth;
408 QQmlProperty height, width;
409 QQmlProperty interactive;
413 QQmlProperty scrollBar;
414 QQmlProperty stepSize;
415 QMetaMethod increaseMethod;
416 QMetaMethod decreaseMethod;
417 QQuickItem* item =
nullptr;
418 bool valid()
const {
return item !=
nullptr; };
419 } m_scrollBarV, m_scrollBarH;
421 bool m_useAnimation =
false;