Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{alias:qsetmenu}

Name

qsetmenu — assign menu to object

...

The qsetmenu command assigns a QMenu qmenu to a widget or tree item.

Arguments

widget

The target widget to receive the action object. This must be an qactionqpushbuttonqtoolbutton, or qtreewidget. If the widget is a QTreeWidget the menu will appear when the user clicks on the tree background.

menu

The menu to be assigned. This must be an instance of qmenu.

itemtype
The tree widget item type. This is an integer corresponding the type parameter supplied in the qtreewidgetitem command. The menu will be a right-click menu for all items having this type.

Examples

See qmainwindow for examples on how to use the qsetmenu command.