Results 1 to 2 of 2

Thread: QMenu close when clicked off

  1. #1
    Join Date
    May 2011
    Posts
    132
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    14

    Default QMenu close when clicked off

    Is there a way to close QMenu pop window when clicked off. Currently it closes when clicked on Action, no no way to check more checkable actions the same time.

  2. #2
    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 close when clicked off

    This is the designed behavior.
    If you want to change it, you will have to subclass, and add some sort of "close" action - either as a menu item, or a button or something, and keep the Menu open until that "close" action is closed.
    But then what you want is not a menu, but a sort of a dialog, where you choose items, and then close it - so why not pop a dialog on a specific menu action, have the user check the wanted actions, and execute them when he closes the dialog?
    ==========================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.

Similar Threads

  1. Gui hangs when close button is clicked
    By Tanny007 in forum Qt Programming
    Replies: 1
    Last Post: 20th April 2012, 06:10
  2. QMenu not working when clicked
    By qtnewbi3 in forum Qt Programming
    Replies: 2
    Last Post: 28th November 2011, 19:59
  3. QMenu popup: how close when clicked outside
    By powermax in forum Qt Programming
    Replies: 5
    Last Post: 4th March 2009, 04:18
  4. how to popup and close a QMenu
    By Placido Currò in forum Qt Programming
    Replies: 15
    Last Post: 14th May 2007, 17:41
  5. Qmenu Stable close on QTableWidget
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 17th July 2006, 11:03

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.