Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, February 2007
QGraphicsItem hover events


Message 1 in thread

Hi, 
  i have a class that inherits QGraphicsItem that reimplements the 
hoverLeaveEvent method. Every instance of this class could have several 
children (that also inherit from QGraphicsItem and reimplement 
hoverLeaveEvent), that are painted inside the item area.
Everytime the mouse moves over one of these children, the hoverLeaveEvent of 
the parent is called, while I don't want this to happen (or I need a way to 
ignore it). Is there a way I can do this?

Enrico Ros




 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Scopri RIS il sistema di ricarica infinita. Meglio delle cartucce, meglio degli inchiostri, economico, facile da installare e da utilizzare, solo su refill.it
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=5191&d=15-2

--
 [ signature omitted ] 

Message 2 in thread

Enrico Ros wrote:
> Hi, 
>   i have a class that inherits QGraphicsItem that reimplements the 
> hoverLeaveEvent method. Every instance of this class could have several 
> children (that also inherit from QGraphicsItem and reimplement 
> hoverLeaveEvent), that are painted inside the item area.
> Everytime the mouse moves over one of these children, the hoverLeaveEvent of 
> the parent is called, while I don't want this to happen (or I need a way to 
> ignore it). Is there a way I can do this?
>   


Have you tried QGraphicsItem::setAcceptsHoverEvents( bool ) ?

--Dave

--
 [ signature omitted ] 

Message 3 in thread

On Thursday 15 February 2007 22:33:51 you wrote:
> Enrico Ros wrote:
> > Hi,
> >   i have a class that inherits QGraphicsItem that reimplements the
> > hoverLeaveEvent method. Every instance of this class could have several
> > children (that also inherit from QGraphicsItem and reimplement
> > hoverLeaveEvent), that are painted inside the item area.
> > Everytime the mouse moves over one of these children, the hoverLeaveEvent
> > of the parent is called, while I don't want this to happen (or I need a
> > way to ignore it). Is there a way I can do this?
>
> Have you tried QGraphicsItem::setAcceptsHoverEvents( bool ) ?

The problem is that I'd like a "stacked" hover, not an exclusive one. Whenever 
some children (accepting hover events) are contained in parent's area, and I 
move the mouse inside that area, I don't want to get 'enter'/'leave' for the 
parent, only for children. The leave event should be emitted when leaving the 
parent's area.
Is there some way to do this in the GraphicsView system ?

Enrico Ros


 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Scopri RIS il sistema di ricarica infinita. Meglio delle cartucce, meglio degli inchiostri, economico, facile da installare e da utilizzare, solo su refill.it
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=5191&d=16-2

--
 [ signature omitted ]