I Can't enable DefaultContextMenu with ContextMenuEvent for my custom widget
I have a custom widget class which just draws a Rectangle of MaximumWidth and length of 30 pixels .Iwant to make it a DefaultcontextMenu.. and also I'm not able to implement the contextMenuEvent for this
I'm very new to this could anyone send me a snippet code for this
Thanks in Advance
Naveen
Re: I Can't enable DefaultContextMenu with ContextMenuEvent for my custom widget
Which version of qt are you using.
Can you show the code here. There is nothing stopping you from re-implementing contextMenuEvent.
Re: I Can't enable DefaultContextMenu with ContextMenuEvent for my custom widget
Quote:
Originally Posted by Naveen
I have a custom widget class which just draws a Rectangle of MaximumWidth and length of 30 pixels .Iwant to make it a DefaultcontextMenu.. and also I'm not able to implement the contextMenuEvent for this
For default context menu the contextMenuEvent is not checked. Default context menu makes use of actions added to a widget (with addAction()). If you want to use contextMenuEvent, you have to switch context menu type to custom.
Re: I Can't enable DefaultContextMenu with ContextMenuEvent for my custom widget
Quote:
Originally Posted by Naveen
.. and also I'm not able to implement the contextMenuEvent for this
I thought this implies that he is unable to compile the code.
Re: I Can't enable DefaultContextMenu with ContextMenuEvent for my custom widget
Sorry, looks like I was wrong here. Default context menu policy is to use contextMenuEvent and not a list of QActions.
So, based on that... can we see the code of contextMenuEvent? :)