Results 1 to 13 of 13

Thread: How to do auto show/hide a widget in Qt

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: How to do auto show/hide a widget in Qt

    QEvent::MouseMove event is received for parent widget, and QEvent::Leave should be received for self widget, so move the else if out of if(parent() ==...., and also make suere to install the event filter on self. (this->installEventFilter(this);
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  2. The following user says thank you to Santosh Reddy for this useful post:

    rawfool (30th May 2013)

  3. #2
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: How to do auto show/hide a widget in Qt

    Thanks a lot. All the issues related to this are solved for now.

  4. #3
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: How to do auto show/hide a widget in Qt

    Just a small note, as this may help someone who do this. After doing this -
    Quote Originally Posted by Santosh Reddy View Post
    QEvent::Leave should be received for self widget ..
    it hides the widget.
    A small problem persisted and it was - if there's a layout and widgets in the mouse-hover area, then the trigger didn't reach the menu widget. I solved it by making the layout and widgets as children to the same parent to which menu widget was and enabled mouse tracking true for the widget(s) on the way and this solved my problem.
    Thank you.

Similar Threads

  1. Replies: 10
    Last Post: 20th April 2015, 22:24
  2. Replies: 1
    Last Post: 9th December 2011, 03:42
  3. Replies: 4
    Last Post: 2nd October 2011, 00:20
  4. Replies: 2
    Last Post: 8th February 2011, 18:07
  5. MAC: Getting Dock widget show/hide events
    By jay in forum Qt Programming
    Replies: 3
    Last Post: 31st May 2010, 08:07

Tags for this Thread

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.