PDA

View Full Version : QTabBar + leaveEvent + mouseMoveEvent



enlightened_j
24th September 2010, 20:18
Hi,

I subclassed QTabBar, call setMouseTracking(true) in the constructor, and re-implement mouseMoveEvent() and leaveEvent() to track the mouse so that my widget can detect mouse moving out of the particular tab also outside of the tabbar.

However, the leaveEvent() is not getting called when I move my cursor beneath the tabbar into the content of the tab. What could be some possible reason behind leaveEvent() not getting called?? Thanks.

Jaosn

enlightened_j
24th September 2010, 23:13
After some break from coding, I realized that I got the declaration wrong in my header. The correct signature is:


void leaveEvent(QEvent *);

and I have


void leaveEvent(QMouseEvent *);