[Interest] mouseReleaseEvent on a QGraphicsItem

Mehmet İpek mhmtipek at gmail.com
Mon Dec 17 14:31:13 CET 2012


If you are handling mouseReleaseEvent in an other widget and don't call
parent widget's mouseReleaseEvent, event won't be propageted to child
widgets.

E.g: CustomWidget inherits QWidget

*CustomWidget::mouseReleaseEvent(QMouseEvent *event)*
*{*
*    // Do your work*
*    QWidget::mouseReleaseEvent(event);*
*}*

I think same thing applies to QGraphicsItems.

On Mon, Dec 17, 2012 at 2:52 PM, Emmanuel Bourgerie <manu.dwarf at gmail.com>wrote:

> Hi !
>
> I have an issue with a subclassed QGraphicsItem, I try to re-implement
> mouseReleaseEvent but it is never triggered.
>
> I read on Google that I wasn't the first one having this issue, but I
> found several leads and no one did work.
>
> So, I did setAcceptHoverEvents(true); in the constructor to handle hover
> events (and it works), no problem with mousePressEvent but I cannot locate
> what is wrong with mouseReleaseEvent.
> I accepted the event in mousePressEvent (it didn't change a thing), I
> tried to make the item selectable, movable, focusable, didn't work.
>
> Is there a specific flag or function in the GraphicsScene I forgot ?
>
> Thanks,
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121217/0badbcf8/attachment.html>


More information about the Interest mailing list