PDA

View Full Version : QMenu to stay open



xmeister
26th March 2009, 02:27
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.

talk2amulya
26th March 2009, 07:38
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.

wysota
26th March 2009, 08:55
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.

xmeister
26th March 2009, 09:23
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.

Rafe
20th July 2012, 03:17
Check this out:
http://stackoverflow.com/questions/2050462/prevent-a-qmenu-from-closing-when-one-of-its-qaction-is-triggered/11571550#11571550