summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/fx/qfxitem.cpp9
-rw-r--r--src/declarative/fx/qfxitem.h1
-rw-r--r--src/declarative/fx/qfxmouseregion.cpp22
-rw-r--r--src/declarative/fx/qfxmouseregion.h2
4 files changed, 15 insertions, 19 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 2d3fa8d..d5c231b 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -1619,10 +1619,7 @@ QPointF QFxItemPrivate::computeTransformOrigin() const
bool QFxItem::sceneEvent(QEvent *event)
{
- bool rv = QGraphicsItem::sceneEvent(event);
- if (event->type() == QEvent::UngrabMouse)
- mouseUngrabEvent();
- return rv;
+ return QGraphicsItem::sceneEvent(event);
}
QVariant QFxItem::itemChange(GraphicsItemChange change,
@@ -1635,10 +1632,6 @@ QVariant QFxItem::itemChange(GraphicsItemChange change,
return QGraphicsItem::itemChange(change, value);
}
-void QFxItem::mouseUngrabEvent()
-{
-}
-
QRectF QFxItem::boundingRect() const
{
Q_D(const QFxItem);
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h
index b1676e4..e1bcb2f 100644
--- a/src/declarative/fx/qfxitem.h
+++ b/src/declarative/fx/qfxitem.h
@@ -226,7 +226,6 @@ protected:
virtual bool sceneEvent(QEvent *);
virtual bool event(QEvent *);
virtual QVariant itemChange(GraphicsItemChange, const QVariant &);
- virtual void mouseUngrabEvent();
void setImplicitWidth(qreal);
bool widthValid() const; // ### better name?
diff --git a/src/declarative/fx/qfxmouseregion.cpp b/src/declarative/fx/qfxmouseregion.cpp
index e4e7442..42e024d 100644
--- a/src/declarative/fx/qfxmouseregion.cpp
+++ b/src/declarative/fx/qfxmouseregion.cpp
@@ -437,17 +437,21 @@ void QFxMouseRegion::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
}
}
-void QFxMouseRegion::mouseUngrabEvent()
+bool QFxMouseRegion::sceneEvent(QEvent *event)
{
- Q_D(QFxMouseRegion);
- if (d->pressed) {
- // if our mouse grab has been removed (probably by Flickable), fix our
- // state
- d->pressed = false;
- setKeepMouseGrab(false);
- emit pressedChanged();
- //emit hoveredChanged();
+ bool rv = QFxItem::sceneEvent(event);
+ if (event->type() == QEvent::UngrabMouse) {
+ Q_D(QFxMouseRegion);
+ if (d->pressed) {
+ // if our mouse grab has been removed (probably by Flickable), fix our
+ // state
+ d->pressed = false;
+ setKeepMouseGrab(false);
+ emit pressedChanged();
+ //emit hoveredChanged();
+ }
}
+ return rv;
}
void QFxMouseRegion::timerEvent(QTimerEvent *event)
diff --git a/src/declarative/fx/qfxmouseregion.h b/src/declarative/fx/qfxmouseregion.h
index 6d85cea..418434a 100644
--- a/src/declarative/fx/qfxmouseregion.h
+++ b/src/declarative/fx/qfxmouseregion.h
@@ -137,7 +137,7 @@ protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
- void mouseUngrabEvent();
+ bool sceneEvent(QEvent *);
void timerEvent(QTimerEvent *event);
private: