PDA

View Full Version : Use ActionsContextMenu or contextMenuEvent



grabnerj
24th June 2008, 05:48
Which do you use and why? What are the pros and cons?

John.

jpn
24th June 2008, 06:44
I use Qt::ActionsContextMenu policy whenever possible because it's the simplest way to construct a static context menu. All you need to do is to add actions with QWidget::addAction() and the rest is done automatically. However, if the context menu needs to be dynamic for example depending on the position of the event, then I'm using Qt::DefaultContextMenu policy.