From b722ac36aef378ed9837f7f4595b4ce2d255f4ac Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 11 Feb 2016 17:42:44 -0200 Subject: TransitionControl: unhandled events are now ignore()'d. Added parent parameter to ctor, as with other components. --- transitioncontrol.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'transitioncontrol.cpp') diff --git a/transitioncontrol.cpp b/transitioncontrol.cpp index 6d3f298..ca12e61 100644 --- a/transitioncontrol.cpp +++ b/transitioncontrol.cpp @@ -8,8 +8,9 @@ // The mouse button used for interaction static const Qt::MouseButton MOUSE_BUTTON = Qt::MiddleButton; -TransitionControl::TransitionControl() - : m_t(1.0) +TransitionControl::TransitionControl(QQuickItem *parent) + : QQuickItem(parent) + , m_t(1.0) , m_startPos(-1) , m_shouldRewind(false) { @@ -28,6 +29,7 @@ void TransitionControl::setT(double t) void TransitionControl::mousePressEvent(QMouseEvent *event) { if (event->button() != MOUSE_BUTTON) { + event->ignore(); return; } @@ -39,6 +41,7 @@ void TransitionControl::mouseMoveEvent(QMouseEvent *event) { int x = event->pos().x(); if (!(event->buttons() & MOUSE_BUTTON) || x > m_startPos || x < 0) { + event->ignore(); return; } @@ -50,6 +53,7 @@ void TransitionControl::mouseMoveEvent(QMouseEvent *event) void TransitionControl::mouseReleaseEvent(QMouseEvent *event) { if (event->button() != MOUSE_BUTTON) { + event->ignore(); return; } -- cgit v1.2.3