diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-09-18 10:56:51 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-10-27 11:06:24 +0000 |
commit | 6115585477bea66d90acbbd8a25b898d121bd50e (patch) | |
tree | e768a73536e7f4219c6e2b2c8eadf88fb931100f /src/quicktemplates2/qquickswipedelegate.cpp | |
parent | 960798f9117bc5aa4aa55bf868cbb0286f8e99b6 (diff) |
QQuickAbstractButton: expose the press point
This has been frequently requested to make it possible to position
context menus, for example. The initial press point is used for drag
threshold, so we need to maintain the current press point separately.
[ChangeLog][Controls][AbstractButton] Added pressX and pressY
properties.
Task-number: QTBUG-62811
Change-Id: Ibb7b9d254ccf68876d5a3049881fee29a45530e4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickswipedelegate.cpp')
-rw-r--r-- | src/quicktemplates2/qquickswipedelegate.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp index 92a5328d..628f5d47 100644 --- a/src/quicktemplates2/qquickswipedelegate.cpp +++ b/src/quicktemplates2/qquickswipedelegate.cpp @@ -736,7 +736,7 @@ bool QQuickSwipeDelegatePrivate::handleMousePressEvent(QQuickItem *item, QMouseE // The press point could be incorrect if the press happened over a child item, // so we correct it after calling the base class' mousePressEvent(), rather // than having to duplicate its code just so we can set the pressPoint. - pressPoint = item->mapToItem(q, event->pos()); + setPressPoint(item->mapToItem(q, event->pos())); q->grabMouse(); return true; } @@ -746,7 +746,7 @@ bool QQuickSwipeDelegatePrivate::handleMousePressEvent(QQuickItem *item, QMouseE // mouse movement in case it turns into a swipe, in which case we grab the mouse. swipePrivate->positionBeforePress = swipePrivate->position; swipePrivate->velocityCalculator.startMeasuring(event->pos(), event->timestamp()); - pressPoint = item->mapToItem(q, event->pos()); + setPressPoint(item->mapToItem(q, event->pos())); // When a delegate uses the attached properties and signals, it declares that it wants mouse events. Attached *attached = attachedObject(item); |