erge remote-tracking branch 'origin/KDE/4.9' into KDE/4.10

This commit is contained in:
Montel Laurent 2012-10-11 22:35:29 +02:00
commit 4eeaf0d718

View File

@ -865,6 +865,41 @@ bool AppletHandle::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{
if (watched == m_applet && event->type() == QEvent::GraphicsSceneHoverLeave) {
hoverLeaveEvent(static_cast<QGraphicsSceneHoverEvent*>(event));
} else if (watched == m_applet && event->type() == QEvent::GraphicsSceneMousePress) {
QGraphicsSceneMouseEvent *me = static_cast<QGraphicsSceneMouseEvent *>(event);
QPointF pos = mapFromScene(me->scenePos());
if (m_applet->contentsRect().contains(pos)) {
return false;
}
me->setPos(pos);
mousePressEvent(me);
return true;
} else if (watched == m_applet && event->type() == QEvent::GraphicsSceneMouseRelease) {
if (m_pressedButton == NoButton) {
return false;
}
QGraphicsSceneMouseEvent *me = static_cast<QGraphicsSceneMouseEvent *>(event);
QPointF pos = mapFromScene(me->scenePos());
me->setPos(pos);
mouseReleaseEvent(me);
return true;
} else if (watched == m_applet && event->type() == QEvent::GraphicsSceneMouseMove) {
if (m_pressedButton == NoButton) {
return false;
}
QGraphicsSceneMouseEvent *me = static_cast<QGraphicsSceneMouseEvent *>(event);
QPointF pos = mapFromScene(me->scenePos());
me->setPos(pos);
mouseMoveEvent(me);
return true;
}
return false;