Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Mouse Click/Press event partially working on QGraphicsPixmaxItem.
IamSumit last edited by IamSumit
I have plotted a QGraphicsPixmaxItem on which i set a transparent pixmap of circle. I am capturing mouse events like mouse click/press on this item successfully.
I observed the two things:
When i click on perimeter of this circle then only i am getting click event, but when i click inside the circle then i am not getting any click event.
My Question is How can in get click event inside the circle ?
Pl45m4 last edited by
Is your circle solid or contains your item only the outline? What boundingRect are you using? Normally the MouseEvents are triggert, when you perform actions inside the items boundingRect.
If you just need a circle, QGraphicsEllipseItem should do the same for you.
see the QGraphicsPixmapItem::setShapeMode()
By default it's
QGraphicsPixmapItem::MaskShape, which means the transparent areas in the pixmap wont be added to it's shape which is responsible for the clickable area.
You want it to set to
QGraphicsPixmapItem::BoundingRectShape, or reimplement