MenuItem
A menu item is either an action, a separator, or a recursive submenu.
Extends
Methods
| Method | Description |
|---|---|
| type() | Returns the type of the item as string, either action, separator, or submenu. |
| isAction() | Returns whether the item is of type action. |
| isSeparator() | Returns whether the item is of type separator. |
| isSubmenu() | Returns whether the item is of type submenu. |
| getSubmenu() | Returns the underlying Menu of this item if it is of type submenu. |
| getAction() | Returns the underlying MenuAction of this item if it is of type action. |
| getSeparator() | Returns the underlying MenuSeparator of this item if it is of type separator. |
Inherited from ClassHandle
| Method | Description |
|---|---|
| isAliasOf() | Returns true if this handle and other alias the same underlying C++ object. |
| delete() | Releases this JavaScript handle. |
| deleteLater() | Schedules this handle for deferred deletion and returns this handle. |
| isDeleted() | Returns true if this handle has already been deleted. |
| [dispose]() | Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually. |
| clone() | Returns a new JavaScript handle aliasing the same underlying C++ object. |
type()
ts
Returns the type of the item as string, either action, separator, or submenu.
Returns
string
isAction()
ts
Returns whether the item is of type action.
Returns
boolean
isSeparator()
ts
Returns whether the item is of type separator.
Returns
boolean
isSubmenu()
ts
Returns whether the item is of type submenu.
Returns
boolean
getSubmenu()
ts
Returns the underlying Menu of this item if it is of type submenu.
Returns
Call this function only if isSubmenu() is true.
getAction()
ts
Returns the underlying MenuAction of this item if it is of type action.
Returns
Call this function only if isAction() is true.
getSeparator()
ts
Returns the underlying MenuSeparator of this item if it is of type separator.
Returns
Call this function only if isSeparator() is true.