aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--transitioncontrol.cpp8
-rw-r--r--transitioncontrol.h2
2 files changed, 7 insertions, 3 deletions
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;
}
diff --git a/transitioncontrol.h b/transitioncontrol.h
index 4c76e8c..6b15679 100644
--- a/transitioncontrol.h
+++ b/transitioncontrol.h
@@ -14,7 +14,7 @@ class TransitionControl :
{
Q_OBJECT
public:
- TransitionControl();
+ TransitionControl(QQuickItem *parent = 0);
double t() const { return m_t; }
signals: