diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-12-27 15:08:04 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-04-27 05:41:21 +0000 |
commit | 5d45aa1a6400b9fdb9bafa0559675996aff5e58a (patch) | |
tree | c5e28c73152b6c5e8b931814668910671968bb38 /src/quick/items | |
parent | f1b4348dae2b992aeaa75e4257c6db4a5182415c (diff) |
Add WheelHandler
It can be used to change any qreal property of its target Item in
response to wheel rotation, or it can be used in other ways that involve
bindings but without a target item.
[ChangeLog][QtQuick][Event Handlers] Added WheelHandler, which handles
mouse wheel rotation by modifying arbitrary Item properties.
Fixes: QTBUG-68119
Change-Id: I247e2325ee993cc1b91a47fbd6c4ba0ffde7ad49
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickevents_p_p.h | 1 | ||||
-rw-r--r-- | src/quick/items/qquickitemsmodule.cpp | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index e614b1bd6d..1a3737091f 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -605,6 +605,7 @@ private: bool m_inverted = false; friend class QQuickWindowPrivate; + friend class QQuickWheelHandler; Q_DISABLE_COPY(QQuickPointerScrollEvent) }; diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index a6dce33f45..2a1c442653 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. @@ -120,6 +120,7 @@ #include "handlers/qquickpinchhandler_p.h" #include "handlers/qquickpointhandler_p.h" #include "handlers/qquicktaphandler_p.h" +#include "handlers/qquickwheelhandler_p.h" QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcTransient) @@ -478,6 +479,9 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) #if QT_CONFIG(quick_tableview) qmlRegisterType<QQuickTableView, 14>(uri, 2, 14, "TableView"); #endif +#if QT_CONFIG(wheelevent) + qmlRegisterType<QQuickWheelHandler>(uri, 2, 14, "WheelHandler"); +#endif } static void initResources() |