aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-09-13 15:50:22 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2017-09-20 09:27:33 +0000
commitae805cafde1f327c9252b9d08449a08f052746d4 (patch)
tree3c26d173701d00dcd4603dceea1f2411c3ffb8c2
parent2aba6e35dc6f1534a764690382ca56b6cf099185 (diff)
Register uncreateable types PointerHandler, EventPoint, EventTouchPoint
If PointerHandler had the intended pressed/updated/released signals, it would be useful for handling EventPoints in arbitrary ways in Javascript. But we are deferring that feature for fear of abuse. And users will never need to create EventPoints, but they can be exposed to QML in rare cases. Change-Id: If86c4e1ba1904f18fb417f23282bd084206da3db Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
-rw-r--r--src/quick/handlers/qquickhandlersmodule.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickhandlersmodule.cpp b/src/quick/handlers/qquickhandlersmodule.cpp
index 4a3a1f6aa2..8472c6a062 100644
--- a/src/quick/handlers/qquickhandlersmodule.cpp
+++ b/src/quick/handlers/qquickhandlersmodule.cpp
@@ -70,13 +70,18 @@ static void qt_quickhandlers_defineModule(const char *uri, int major, int minor)
QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &autoparent);
qmlRegisterUncreatableType<QQuickPointerEvent>(uri, major, minor, "PointerEvent",
QQuickPointerHandler::tr("PointerEvent is only available as a parameter of several signals in PointerHandler"));
+ qmlRegisterUncreatableType<QQuickEventPoint>(uri, major, minor, "EventPoint",
+ QQuickPointerHandler::tr("EventPoint is only available as a member of PointerEvent"));
+ qmlRegisterUncreatableType<QQuickEventTouchPoint>(uri, major, minor, "EventTouchPoint",
+ QQuickPointerHandler::tr("EventTouchPoint is only available as a member of PointerEvent"));
qmlRegisterUncreatableType<QQuickPointerDevice>(uri, major, minor, "PointerDevice",
QQuickPointerHandler::tr("PointerDevice is only available as a property of PointerEvent"));
qRegisterMetaType<QPointingDeviceUniqueId>("QPointingDeviceUniqueId");
qmlRegisterUncreatableType<QPointingDeviceUniqueId>(uri, major, minor, "PointingDeviceUniqueId",
QQuickPointerHandler::tr("PointingDeviceUniqueId is only available as a property of PointerEvent"));
- qmlRegisterType<QQuickPointerHandler>(uri,major,minor,"PointerHandler");
+ qmlRegisterUncreatableType<QQuickPointerHandler>(uri,major,minor,"PointerHandler",
+ QQuickPointerHandler::tr("PointerHandler is an abstract base class"));
qmlRegisterType<QQuickDragHandler>(uri,major,minor,"DragHandler");
qmlRegisterUncreatableType<QQuickDragAxis>(uri, major, minor, "DragAxis",
QQuickDragHandler::tr("DragAxis is only available as a grouped property of DragHandler"));