PDA

View Full Version : QGraphicsItem::hoverEnterEvent problem



xgoan
15th February 2007, 13:56
Hi,

i'm developing a level editor for a "game". And I have a QGraphicsScene with QGraphicsPolygonItem inherit's classes. But I can't get the hoverEnterEvent to work.

Anyone can help me?

Angelo Moriconi
15th February 2007, 15:36
Have you call


setAcceptsHoverEvents(true);

on the QGraphicsPolygonItem ?

xgoan
16th February 2007, 07:27
Yes, I did

I have found the problem:

I had insert the squares into a QGraphicsItemGroup and this makes that the squares can't use their events... Strange

Thanks anyway

Bitto
24th February 2007, 15:21
QGraphicsItemGroup has the handlesChildEvents (http://doc.trolltech.com/4.2/qgraphicsitem.html#handlesChildEvents) property enabled; it eats all events delivered to any of its descendents. You use QGraphicsItemGroup if you need to treat a group of items as one.