mouseTracking in two widgets at the same time?
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.
Re: mouseTracking in two widgets at the same time?
Did you call setMouseTracking(true) for both widgets?
Re: mouseTracking in two widgets at the same time?
Yes, I call it in both I widgets
Re: mouseTracking in two widgets at the same time?
Yes, I call it in both widgets: one widget is a widget itself and the other a main window...
Re: mouseTracking in two widgets at the same time?
it must work clearly!
maiby some mistakes in code? show code fragments that release your mouse move events:rolleyes:
Re: mouseTracking in two widgets at the same time?
Quote:
Originally Posted by SkripT
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.
Re: mouseTracking in two widgets at the same time?
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?