Results 1 to 5 of 5

Thread: QMenu to stay open

  1. #1

    Default QMenu to stay open

    hi,
    I have a QMenu that drops down from a button and allows the user to check QActions to show/hide columns in a table view. I know it goes against the standard way in which users expect menu's to work but in this case I think it is appropriate.
    I'd like to have the menu stay open even after an action is clicked/checked. Ideally it would stay open until the user mouses out of the menu drop down or even if they have to re-click the button or just click out of the menu drop down.

    I'm also open to suggestions on alternatives to achieve a similar functionality.

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMenu to stay open

    i'd suggest instead of using qmenu, u create your own widget easily from designer and show that widget on the click of a button(just like a menu)..on the focus out event of that widget, u can close it..it will give u more control on whatever u wanna do with that menu.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMenu to stay open

    You could use QMenu but you have to change its window type from popup to something more persistent.

    Instead of such wacky design I would suggest to use a toolbar or a dock widget to act as a floating "palette" of actions.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4

    Default Re: QMenu to stay open

    Thanks for the responses.

    I had a feeling there wasn't a simple way to have a menu stay open. Think I'll create a custom widget but I'll have a play with a toolbar too and see what's going to work best.

    Thanks again.

  5. #5
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    1
    Qt products
    Qt4

    Default Re: QMenu to stay open


Similar Threads

  1. Replies: 3
    Last Post: 7th October 2015, 19:43
  2. QMenu popup: how close when clicked outside
    By powermax in forum Qt Programming
    Replies: 5
    Last Post: 4th March 2009, 03:18
  3. QTextBrowser: Cannot open
    By veda in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2007, 12:05
  4. how to popup and close a QMenu
    By Placido Currò in forum Qt Programming
    Replies: 15
    Last Post: 14th May 2007, 16:41
  5. Qmenu Stable close on QTableWidget
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 17th July 2006, 10: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.