QMenu

The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.

This class is a JS wrapper around Qt's QMenu class

QMenu inherits from NodeWidget

Example

const { QMenu } = require("@nodegui/nodegui");
const menu = new QMenu();

new QMenu(parent?)

  • parent NodeWidget (optional). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.

Static Methods

QMenu can access all the static methods defined in NodeWidget

Instance Properties

QMenu can access all the instance properties defined in NodeWidget

Instance Methods

QMenu can access all the instance methods defined in NodeWidget. Additionally it also has the following instance methods:

menu.setTitle(title)

This property holds the title of the menu. It calls the native method QMenu: setTitle.

  • title string

menu.addAction(action)

Appends the action action to this widget's list of actions. It calls the native method QMenu: addAction.