aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitemsmodule.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-07-04 20:05:00 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-09-19 15:37:11 +0200
commitab5df626bef9365089ce716ce476bccae1d0a04b (patch)
tree7ca558d24ad391b2cdfbe468a3752270eabd0466 /src/quick/items/qquickitemsmodule.cpp
parent227be82e4cf4b0fc58d4d50154cee7c45eb03777 (diff)
Add dragThreshold property to Event Handlers
We need drag threshold to be adjustable on each handler instance instead of relying only on the system default drag threshold. For example in some use cases DragHandler needs to work with a threshold of 0 or 1 to start dragging as soon as the point is pressed or as soon as the point is moved, with no "jump", to enable fine adjustment of a value on some control such as a Slider. This involves moving the dragOverThreshold() functions that handlers are using from QQuickWindowPrivate to QQuickPointerHandlerPrivate, so that they can use the adjustable threshold value. Task-number: QTBUG-68075 Change-Id: Ie720cbbf9f30abb40d1731d92f8e7f1e6534eeb5 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickitemsmodule.cpp')
-rw-r--r--src/quick/items/qquickitemsmodule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp
index f2098f6732..fbfb7521ea 100644
--- a/src/quick/items/qquickitemsmodule.cpp
+++ b/src/quick/items/qquickitemsmodule.cpp
@@ -497,6 +497,9 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
QQuickPointerHandler::tr("ImageBase is an abstract base class"));
qmlRegisterType<QQuickImage, 14>(uri, 2, 14, "Image");
qmlRegisterType<QQuickDragHandler, 14>(uri, 2, 14, "DragHandler");
+
+ qmlRegisterUncreatableType<QQuickPointerHandler, 15>(uri, 2, 15, "PointerHandler",
+ QQuickPointerHandler::tr("PointerHandler is an abstract base class"));
}
static void initResources()