diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-07 01:01:54 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-07 01:01:55 +0100 |
commit | e04e5db13d2a1d03e4afe139fcc29e0ed5b1edab (patch) | |
tree | ca450c633cbce2c86293b302d6e448e652e0136b /src/quick/handlers/qquickpinchhandler.cpp | |
parent | 6a7c8749712c33e27cdbc93efdf54eddf8e7631f (diff) | |
parent | 895302829b46e00cde8eef13eb7c630af5d771e2 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-alpha1
Change-Id: I5209d833e171c795556c075e2a5f964b59b6df2e
Diffstat (limited to 'src/quick/handlers/qquickpinchhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickpinchhandler.cpp | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp index a0fec37443..9ae2116d39 100644 --- a/src/quick/handlers/qquickpinchhandler.cpp +++ b/src/quick/handlers/qquickpinchhandler.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include "qquickpinchhandler_p.h" +#include <QtQml/qqmlinfo.h> #include <QtQuick/qquickwindow.h> #include <private/qsgadaptationlayer_p.h> #include <private/qquickitem_p.h> @@ -151,57 +152,48 @@ void QQuickPinchHandler::setMaximumRotation(qreal maximumRotation) emit maximumRotationChanged(); } -/*! - \qmlproperty real QtQuick::PinchHandler::minimumX +#if QT_DEPRECATED_SINCE(5, 12) +void QQuickPinchHandler::warnAboutMinMaxDeprecated() const +{ + qmlWarning(this) << "min and max constraints are now part of the xAxis and yAxis properties"; +} - The minimum acceptable x coordinate of the centroid -*/ void QQuickPinchHandler::setMinimumX(qreal minX) { + warnAboutMinMaxDeprecated(); if (qFuzzyCompare(m_minimumX, minX)) return; m_minimumX = minX; emit minimumXChanged(); } -/*! - \qmlproperty real QtQuick::PinchHandler::maximumX - - The maximum acceptable x coordinate of the centroid -*/ void QQuickPinchHandler::setMaximumX(qreal maxX) { + warnAboutMinMaxDeprecated(); if (qFuzzyCompare(m_maximumX, maxX)) return; m_maximumX = maxX; emit maximumXChanged(); } -/*! - \qmlproperty real QtQuick::PinchHandler::minimumY - - The minimum acceptable y coordinate of the centroid -*/ void QQuickPinchHandler::setMinimumY(qreal minY) { + warnAboutMinMaxDeprecated(); if (qFuzzyCompare(m_minimumY, minY)) return; m_minimumY = minY; emit minimumYChanged(); } -/*! - \qmlproperty real QtQuick::PinchHandler::maximumY - - The maximum acceptable y coordinate of the centroid -*/ void QQuickPinchHandler::setMaximumY(qreal maxY) { + warnAboutMinMaxDeprecated(); if (qFuzzyCompare(m_maximumY, maxY)) return; m_maximumY = maxY; emit maximumYChanged(); } +#endif bool QQuickPinchHandler::wantsPointerEvent(QQuickPointerEvent *event) { @@ -230,6 +222,32 @@ bool QQuickPinchHandler::wantsPointerEvent(QQuickPointerEvent *event) } /*! + \qmlpropertygroup QtQuick::PinchHandler::xAxis + \qmlproperty real QtQuick::PinchHandler::xAxis.minimum + \qmlproperty real QtQuick::PinchHandler::xAxis.maximum + \qmlproperty bool QtQuick::PinchHandler::xAxis.enabled + + \c xAxis controls the constraints for horizontal translation of the \l target item. + + \c minimum is the minimum acceptable x coordinate of the translation. + \c maximum is the maximum acceptable x coordinate of the translation. + If \c enabled is true, horizontal dragging is allowed. + */ + +/*! + \qmlpropertygroup QtQuick::PinchHandler::yAxis + \qmlproperty real QtQuick::PinchHandler::yAxis.minimum + \qmlproperty real QtQuick::PinchHandler::yAxis.maximum + \qmlproperty bool QtQuick::PinchHandler::yAxis.enabled + + \c yAxis controls the constraints for vertical translation of the \l target item. + + \c minimum is the minimum acceptable y coordinate of the translation. + \c maximum is the maximum acceptable y coordinate of the translation. + If \c enabled is true, vertical dragging is allowed. + */ + +/*! \qmlproperty int QtQuick::PinchHandler::minimumTouchPoints The pinch begins when this number of fingers are pressed. |