diff --git a/widgets/icon.cpp b/widgets/icon.cpp index 2c9b11851..db3c95488 100644 --- a/widgets/icon.cpp +++ b/widgets/icon.cpp @@ -922,8 +922,9 @@ void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event) d->state = Private::PressedState; emit pressed(true); + emit pressed(true, event); - event->ignore(); + event->accept(); update(); } @@ -948,9 +949,11 @@ void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (was == Private::PressedState) { emit pressed(false); + emit pressed(false, event); if (inside) { emit clicked(); + emit clicked(event); } d->state = Private::NoState; } diff --git a/widgets/icon.h b/widgets/icon.h index b86e8bdbb..a31f58ae1 100644 --- a/widgets/icon.h +++ b/widgets/icon.h @@ -177,11 +177,13 @@ Q_SIGNALS: * Indicates when the icon has been pressed. */ void pressed(bool down); + void pressed(bool down, QGraphicsSceneMouseEvent *event); /** * Indicates when the icon has been clicked. */ void clicked(); + void clicked(QGraphicsSceneMouseEvent *event); protected: bool isDown();