AvogadroApp
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MenuBuilder Class Reference
Inheritance diagram for MenuBuilder:

Public Member Functions

void addAction (const QStringList &path, QAction *action, int priority=-1)
 
void buildMenuBar (QMenuBar *menuBar)
 
void buildMenu (QMenu *menu, const QString &path)
 
void print ()
 
const QMap< QString, QList< QAction * > > & getMenuActions () const
 

Member Function Documentation

◆ addAction()

void addAction ( const QStringList &  path,
QAction *  action,
int  priority = -1 
)

Add a new action to the menu builder object.

Parameters
pathThe menu path, where each element specifies a menu level.
actionThe action that will be added at the path.
priorityThe priority of the entry, higher will be at the top.

◆ buildMenuBar()

void buildMenuBar ( QMenuBar *  menuBar)

Populate the supplied menu bar with the items added to builder. Ordering is attempted, ensuring File is first, Help is last and ordering by priority and then alphanumerically.

Parameters
menuThe menu to be populated.

◆ buildMenu()

void buildMenu ( QMenu *  menu,
const QString &  path 
)

Populate a menu with the appropriate sub-entries.

◆ print()

void print ( )

Print the contents of the MenuBuilder, intended for debug.

◆ getMenuActions()

const QMap< QString, QList< QAction * > > & getMenuActions ( ) const

Get the map of string to action lists.