User Tools

Site Tools


DzMenu

Basic Menu construction class.

More...

Inherits :

Methods

DAZ Script
NumberaddAction ( DzAction action, Number menu=0 )
NumberaddItem ( String item, Number menu=0 )
NumberaddItem ( String item, const receiver, String member, Number menu=0 )
voidaddSeparator ( Number menu=0 )
NumberaddSubMenu ( String label, Number menu=0 )
Numberexec ( Point pos )
Numberexec ()
NumberfindSubMenu ( String label, Number menu=0 )
BooleanisEmpty ()

Signals

voidactivated ( Number id )

Detailed Description

TODO: Add detailed description.

Methods


Number : addAction( DzAction action, Number menu=0 )

Adds the DzAction to the given menu.

Parameter(s):

  • action - A pointer to the action item to add to the menu.
  • menu - The menu id of the menu to add the action to. If zero, the action will be added to the root menu.

Return Value:

  • The item id of the action in the menu.

Number : addItem( String item, Number menu=0 )

Adds an entry to the given menu.

Parameter(s):

  • item - The label that will appear in the menu for the user to activate the item.
  • menu - The menu id of the menu to add the item to. If zero, the item will be added to the root menu.

Return Value:

  • The item id of the new menu item.

Number : addItem( String item, const receiver, String member, Number menu=0 )

Adds an entry to the given menu and connects it to a slot.

Parameter(s):

  • item - The label that will appear in the menu for the user to activate the item.
  • receiver - The QObject to connect the activate signal to.
  • member - The slot/signal that will be connect to the activate signal.
  • menu - The menu id of the menu to add the item to. If zero, the item will be added to the root menu.

Return Value:

  • The item id of the new menu item.

void : addSeparator( Number menu=0 )

Adds a separator bar to the given menu.

Parameter(s):

  • menu - The menu id of the menu to add the separator to. If zero, the separator will be added to the root menu.

Number : addSubMenu( String label, Number menu=0 )

Creates a submenu with the given label, and adds it to the given menu.

Parameter(s):

  • label - The text that will appear in the parent menu for the user to activate the submenu.
  • menu - The menu id of the parent menu to add the submenu to. If zero, the submenu will be added to the root menu.

Return Value:

  • The menu id of the new submenu.

Number : exec( Point pos )

Shows the menu to the user.

Parameter(s):

  • pos - The global position that the menu will be displayed at.

Return Value:

  • The item id of the item selected by the user, or -1 if the menu was closed without the user selecting an item.

Number : exec()

Shows the menu to the user.

Return Value:

  • The item id of the item selected by the user, or -1 if the menu was closed without the user selecting an item.

Number : findSubMenu( String label, Number menu=0 )

Finds a submenu with the given label, and returns its menu id.

Parameter(s):

  • label - The text that appears in the parent menu for the user to activate the submenu.
  • menu - The menu id of the parent menu to search for the submenu in. If zero, the root menu will be searched.

Return Value:

  • The menu id of the new submenu, -1 if submenu is not found.

Boolean : isEmpty()

Return Value:

  • true if no items or actions have been added to the menu.

Signals


void : activated( Number id )

Signature:“activated(int)”

Emitted when the user selects an item in the menu, or one of its submenus.

Parameter(s):

  • id - The item id of the item the user selected.