Results 1 to 11 of 11

Thread: QMenu: remain visible while mouseOver

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: QMenu: remain visible while mouseOver

    Obviously, I need to test whether the mouse is over the menu or not, like in the comments.
    I thought it was abovious too.
    You didn't expect us to deliver you every little detail did you?

    If I understand correctly, you want to have the menu stay visible as long as your cursor is above it, even if you made your selection - is that correct?
    So testing to see if the mouse button is clicked wont bring much.

    But you could try the following:
    Qt Code:
    1. void Window::menuSL()
    2. {
    3. if(myMenu->isUnderMouse())
    4. myMenu->show();
    5. }
    To copy to clipboard, switch view to plain text mode 

    and in your event filter, look for QEvent::Leave to hide the menu once the mouse has left it.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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

    vonCZ (24th October 2007)

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.