libyui-qt  2.56.2
YQMenuBar Class Reference
Inheritance diagram for YQMenuBar:
Collaboration diagram for YQMenuBar:

Public Member Functions

 YQMenuBar (YWidget *parent)
 Constructor.
 
virtual ~YQMenuBar ()
 Destructor.
 
virtual void rebuildMenuTree ()
 Rebuild the displayed menu tree from the internally stored YMenuItems. More...
 
virtual void setEnabled (bool enabled)
 Set enabled / disabled state. More...
 
virtual int preferredWidth ()
 Preferred width of the widget. More...
 
virtual int preferredHeight ()
 Preferred height of the widget. More...
 
virtual void setSize (int newWidth, int newHeight)
 Set the new size of the widget. More...
 
virtual bool setKeyboardFocus ()
 Accept the keyboard focus.
 
virtual void setItemEnabled (YMenuItem *item, bool enabled)
 Enable or disable an item. More...
 
virtual void setItemVisible (YMenuItem *item, bool visible)
 Show or hide an item. More...
 
virtual void activateItem (YMenuItem *item)
 Activate the item selected in the tree. More...
 
virtual void shortcutChanged ()
 Notification that some shortcut was changed. More...
 

Protected Slots

void menuEntryActivated (QAction *menuItem)
 Triggered when any menu item is activated.
 
void returnNow ()
 Triggered via menuEntryActivated() by zero timer to get back in sync with the Qt event loop.
 

Protected Member Functions

void rebuildMenuTree (QMenu *menu, YItemIterator begin, YItemIterator end)
 Recursively insert menu items into 'menu' from iterator 'begin' to iterator 'end'.
 

Protected Attributes

YMenuItem * _selectedItem
 
QMap< QAction *, YMenuItem * > _actionMap
 

Detailed Description

Definition at line 37 of file YQMenuBar.h.

Member Function Documentation

◆ activateItem()

void YQMenuBar::activateItem ( YMenuItem *  item)
virtual

Activate the item selected in the tree.

Can be used in tests to simulate user input.

Definition at line 268 of file YQMenuBar.cc.

Here is the call graph for this function:

◆ preferredHeight()

int YQMenuBar::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

Definition at line 245 of file YQMenuBar.cc.

◆ preferredWidth()

int YQMenuBar::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

Definition at line 239 of file YQMenuBar.cc.

◆ rebuildMenuTree()

void YQMenuBar::rebuildMenuTree ( )
virtual

Rebuild the displayed menu tree from the internally stored YMenuItems.

Implemented from YMenuWidget.

Definition at line 57 of file YQMenuBar.cc.

Here is the call graph for this function:

◆ setEnabled()

void YQMenuBar::setEnabled ( bool  enabled)
virtual

Set enabled / disabled state.

Reimplemented from YWidget.

Definition at line 233 of file YQMenuBar.cc.

◆ setItemEnabled()

void YQMenuBar::setItemEnabled ( YMenuItem *  item,
bool  enabled 
)
virtual

Enable or disable an item.

Reimplemented from YMenuWidget.

Definition at line 185 of file YQMenuBar.cc.

◆ setItemVisible()

void YQMenuBar::setItemVisible ( YMenuItem *  item,
bool  visible 
)
virtual

Show or hide an item.

Reimplemented from YMenuWidget.

Definition at line 209 of file YQMenuBar.cc.

◆ setSize()

void YQMenuBar::setSize ( int  newWidth,
int  newHeight 
)
virtual

Set the new size of the widget.

Reimplemented from YWidget.

Definition at line 252 of file YQMenuBar.cc.

◆ shortcutChanged()

void YQMenuBar::shortcutChanged ( )
virtual

Notification that some shortcut was changed.

Reimplemented from YSelectionWidget.

Definition at line 276 of file YQMenuBar.cc.

Here is the call graph for this function:

The documentation for this class was generated from the following files: