PDA

View Full Version : mouseTracking in two widgets at the same time?



SkripT
29th January 2006, 22:39
Hi, I want to know if it's possible to have two different widgets with mouseTracking enabled at the same time. I'm asking it because I have tried it and only with one widget mouseMoveEvent was executed everytime the mouse moves while in the other widget only if if i press a button and move the mouse the mouseMoveEvent is called. Anyone could explain me why? Thanks.

Chicken Blood Machine
30th January 2006, 00:04
Did you call setMouseTracking(true) for both widgets?

SkripT
30th January 2006, 11:58
Yes, I call it in both I widgets

SkripT
30th January 2006, 11:59
Yes, I call it in both widgets: one widget is a widget itself and the other a main window...

zlatko
30th January 2006, 14:15
it must work clearly!
maiby some mistakes in code? show code fragments that release your mouse move events:rolleyes:

Chicken Blood Machine
30th January 2006, 18:01
Yes, I call it in both widgets: one widget is a widget itself and the other a main window...

Is there a widget inside that main window? You must set mouse tracking true for that, since if a widget contains another, it will not track mouse move events when the mouse cursor is within the contained widget.

SkripT
30th January 2006, 18:29
I comment how I have the main window: as a central widget I have a scroll area, inside the scroll area I have the widget that has mouseTracking enabled. For the scroll area I don't need mouse tracking. In the three wigets (the main window, the scroll area and the widget itself) I reimplement the mouseMoveEvent. At the end of the mouseMoveEvent of the widget I call to event::ignore, so the event is propagated to it's parent, the scroll area. And the same for the scroll area, so the event is propagated to the main window (also runs if I don't put it). That's the situation. For the widget of the scroll area the mouseTracking works but for the main window only if I press a button of the mouse and I move it, the mouseMoveEvent is executed. Chicken Blood Machine dou you mind that I have to put the mouseTracking enabled also for the scroll area?