summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-08-05 00:23:26 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-08-05 00:23:26 (GMT)
commit2472959ba8c0dbd404ab038710e5df74723a1780 (patch)
treec867a4f8cb3150c94ae8554e26e612af0527d311
parent7e268329fb6345d92765e2d8f531ecc5dcc51219 (diff)
downloadQt-2472959ba8c0dbd404ab038710e5df74723a1780.zip
Qt-2472959ba8c0dbd404ab038710e5df74723a1780.tar.gz
Qt-2472959ba8c0dbd404ab038710e5df74723a1780.tar.bz2
More QFxItem cleanup.
-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: