diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-11-16 18:00:42 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-11-17 07:09:20 +0000 |
commit | d710a3a5b7a0b120d84674dc328418930b87b774 (patch) | |
tree | 9e82ae55a5559a4cd2c184433b03dbd656dcddc2 | |
parent | 6990ae6c1bad32952e371fa72bee65a7af11c313 (diff) |
Document QQuickGrabGestureEvent
Documentation has been missing since the beginning.
Making it an uncreatable type provides the opportunity to associate
the C++ type with the QML type so that the latter can be used in the
QML documentation, as opposed to simply registering the C++ type
with no QML name as was done before.
Task-number: QTBUG-47290
Task-number: QTBUG-63143
Change-Id: Ib82cc7b27c9591eaf2c7997d2781a2b4246cfbff
Reviewed-by: Michael Brasser <michael.brasser@live.com>
-rw-r--r-- | src/quick/items/qquickitemsmodule.cpp | 3 | ||||
-rw-r--r-- | src/quick/items/qquickmultipointtoucharea.cpp | 37 |
2 files changed, 39 insertions, 1 deletions
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index 5f6d44b54d..489b1cbd03 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -287,7 +287,8 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickMultiPointTouchArea>("QtQuick", 2, 0, "MultiPointTouchArea"); qmlRegisterType<QQuickTouchPoint>("QtQuick", 2, 0, "TouchPoint"); - qmlRegisterType<QQuickGrabGestureEvent>(); + qmlRegisterUncreatableType<QQuickGrabGestureEvent>(uri,major,minor, "GestureEvent", + QQuickMouseEvent::tr("GestureEvent is only available in the context of handling the gestureStarted signal from MultiPointTouchArea")); #if QT_CONFIG(accessibility) qmlRegisterUncreatableType<QQuickAccessibleAttached>("QtQuick", 2, 0, "Accessible",QQuickAccessibleAttached::tr("Accessible is only available via attached properties")); diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp index d4c447a384..8866ca2be5 100644 --- a/src/quick/items/qquickmultipointtoucharea.cpp +++ b/src/quick/items/qquickmultipointtoucharea.cpp @@ -285,6 +285,43 @@ void QQuickTouchPoint::setUniqueId(const QPointingDeviceUniqueId &id) emit uniqueIdChanged(); } + +/*! + \qmltype GestureEvent + \instantiates QQuickGrabGestureEvent + \inqmlmodule QtQuick + \ingroup qtquick-input-events + \brief The parameter given with the gestureStarted signal + + The GestureEvent object has the current touch points, which you may choose + to interpret as a gesture, and an invokable method to grab the involved + points exclusively. +*/ + +/*! + \qmlproperty real QtQuick::GestureEvent::dragThreshold + + This property holds the system setting for the distance a finger must move + before it is interpreted as a drag. It comes from + QStyleHints::startDragDistance(). +*/ + +/*! + \qmlproperty list<TouchPoint> QtQuick::GestureEvent::touchPoints + + This property holds the set of current touch points. +*/ + +/*! + \qmlmethod QtQuick::GestureEvent::grab() + + Acquires an exclusive grab of the mouse and all the \l touchPoints, and + calls \l {QQuickItem::setKeepTouchGrab()}{setKeepTouchGrab()} and + \l {QQuickItem::setKeepMouseGrab()}{setKeepMouseGrab()} so that any + parent Item that \l {QQuickItem::filtersChildMouseEvents()}{filters} its + children's events will not be allowed to take over the grabs. +*/ + /*! \qmltype MultiPointTouchArea \instantiates QQuickMultiPointTouchArea |