Forward wheel events to the wallpaper

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=857101
This commit is contained in:
Benoît Jacob 2008-09-04 18:11:46 +00:00
parent dcaf4a4b8a
commit 6d24078bc7
3 changed files with 27 additions and 0 deletions

View File

@ -991,6 +991,20 @@ void Containment::keyPressEvent(QKeyEvent *event)
void Containment::wheelEvent(QGraphicsSceneWheelEvent *event)
{
if (d->wallpaper) {
QGraphicsItem* item = scene()->itemAt(event->scenePos());
if (item == this) {
event->ignore();
d->wallpaper->mouseWheelEvent(event);
if (event->isAccepted()) {
return;
}
event->accept();
}
}
if (containmentType() == DesktopContainment) {
QGraphicsItem* item = scene()->itemAt(event->scenePos());
if (item == this) {

View File

@ -217,6 +217,11 @@ void Wallpaper::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Q_UNUSED(event)
}
void Wallpaper::mouseWheelEvent(QGraphicsSceneWheelEvent *event)
{
Q_UNUSED(event)
}
} // Plasma namespace
#include "wallpaper.moc"

View File

@ -186,6 +186,14 @@ class PLASMA_EXPORT Wallpaper : public QObject
*/
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
/**
* Mouse wheel event. To prevent further propagation of the event,
* the event must be accepted.
*
* @param event the wheel event object
*/
virtual void mouseWheelEvent(QGraphicsSceneWheelEvent *event);
Q_SIGNALS:
/**
* This signal indicates that wallpaper needs to be repainted.