Results 1 to 2 of 2

Thread: QTabBar + leaveEvent + mouseMoveEvent

  1. #1
    Join Date
    Aug 2010
    Posts
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default QTabBar + leaveEvent + mouseMoveEvent

    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

  2. #2
    Join Date
    Aug 2010
    Posts
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: QTabBar + leaveEvent + mouseMoveEvent

    After some break from coding, I realized that I got the declaration wrong in my header. The correct signature is:

    Qt Code:
    1. void leaveEvent(QEvent *);
    To copy to clipboard, switch view to plain text mode 

    and I have

    Qt Code:
    1. void leaveEvent(QMouseEvent *);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. mouseMoveEvent
    By weixj2003ld in forum Qt Programming
    Replies: 1
    Last Post: 3rd November 2009, 09:04
  2. About the mouseMoveEvent()
    By bingoking in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2008, 11:56
  3. leaveEvent on transparent area issue
    By nooky59 in forum Qt Programming
    Replies: 10
    Last Post: 8th January 2008, 13:22
  4. QWidget::leaveEvent
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 15th October 2007, 17:28
  5. enterEvent, leaveEvent, setWindowFlags
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2007, 09:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.