aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickevents.cpp
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@qt.io>2017-02-21 16:10:27 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-02-22 05:39:19 +0000
commit7c3baca698d5e3e6481a248a7d6c6abc41696304 (patch)
tree9e9c374d8342601f2f900705daa5d7afb3e52725 /src/quick/items/qquickevents.cpp
parent55cb6574d41ff6e50d2956d7c6f1dd5ac1315741 (diff)
QQuickEventPoint API changes after API review
* localize -> localizePosition * remove isValid and invalidate * remove isDraggedOverThreshold * remove Q_INVOKABLEs Change-Id: I21f788beb1e86275a9b7a1f1014998b2569001d0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents.cpp')
-rw-r--r--src/quick/items/qquickevents.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index cddcf02955..0c06ecd677 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -541,7 +541,6 @@ void QQuickEventPoint::reset(Qt::TouchPointState state, const QPointF &scenePos,
}
m_pointId = pointId;
}
- m_valid = true;
m_accept = false;
m_state = static_cast<QQuickEventPoint::State>(state);
m_timestamp = timestamp;
@@ -552,7 +551,7 @@ void QQuickEventPoint::reset(Qt::TouchPointState state, const QPointF &scenePos,
m_velocity = (Q_LIKELY(velocity.isNull()) ? estimatedVelocity() : velocity);
}
-void QQuickEventPoint::localize(QQuickItem *target)
+void QQuickEventPoint::localizePosition(QQuickItem *target)
{
if (target)
m_pos = target->mapFromScene(scenePos());
@@ -560,12 +559,6 @@ void QQuickEventPoint::localize(QQuickItem *target)
m_pos = QPointF();
}
-void QQuickEventPoint::invalidate()
-{
- m_valid = false;
- m_pointId = 0;
-}
-
/*!
If this point has an exclusive grabber, returns a pointer to it; else
returns null, if there is no grabber. The grabber could be either
@@ -756,13 +749,6 @@ void QQuickEventPoint::setAccepted(bool accepted)
}
}
-bool QQuickEventPoint::isDraggedOverThreshold() const
-{
- QPointF delta = scenePos() - scenePressPos();
- return (QQuickWindowPrivate::dragOverThreshold(delta.x(), Qt::XAxis, this) ||
- QQuickWindowPrivate::dragOverThreshold(delta.y(), Qt::YAxis, this));
-}
-
QQuickEventTouchPoint::QQuickEventTouchPoint(QQuickPointerTouchEvent *parent)
: QQuickEventPoint(parent), m_rotation(0), m_pressure(0)
{}
@@ -885,7 +871,7 @@ QQuickPointerEvent *QQuickPointerMouseEvent::reset(QEvent *event)
void QQuickPointerMouseEvent::localize(QQuickItem *target)
{
- m_mousePoint->localize(target);
+ m_mousePoint->localizePosition(target);
}
QQuickPointerEvent *QQuickPointerTouchEvent::reset(QEvent *event)
@@ -944,7 +930,7 @@ QQuickPointerEvent *QQuickPointerTouchEvent::reset(QEvent *event)
void QQuickPointerTouchEvent::localize(QQuickItem *target)
{
for (auto point : qAsConst(m_touchPoints))
- point->localize(target);
+ point->localizePosition(target);
}
QQuickEventPoint *QQuickPointerMouseEvent::point(int i) const {
@@ -961,7 +947,7 @@ QQuickEventPoint *QQuickPointerTouchEvent::point(int i) const {
QQuickEventPoint::QQuickEventPoint(QQuickPointerEvent *parent)
: QObject(parent), m_pointId(0), m_exclusiveGrabber(nullptr), m_timestamp(0), m_pressTimestamp(0),
- m_state(QQuickEventPoint::Released), m_valid(false), m_accept(false), m_grabberIsHandler(false)
+ m_state(QQuickEventPoint::Released), m_accept(false), m_grabberIsHandler(false)
{
Q_UNUSED(m_reserved);
}
@@ -1306,7 +1292,7 @@ Q_QUICK_PRIVATE_EXPORT QDebug operator<<(QDebug dbg, const QQuickPointerEvent *e
Q_QUICK_PRIVATE_EXPORT QDebug operator<<(QDebug dbg, const QQuickEventPoint *event) {
QDebugStateSaver saver(dbg);
dbg.nospace();
- dbg << "QQuickEventPoint(valid:" << event->isValid() << " accepted:" << event->isAccepted()
+ dbg << "QQuickEventPoint(accepted:" << event->isAccepted()
<< " state:";
QtDebugUtils::formatQEnum(dbg, event->state());
dbg << " scenePos:" << event->scenePos() << " id:" << hex << event->pointId() << dec