libyui-qt  2.52.2
YQMenuButton Class Reference
Inheritance diagram for YQMenuButton:
Collaboration diagram for YQMenuButton:

Public Member Functions

 YQMenuButton (YWidget *parent, const std::string &label)
 Constructor.
 
virtual ~YQMenuButton ()
 Destructor.
 
virtual void setLabel (const std::string &label)
 Change the label on the button. More...
 
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 activateItem (YMenuItem *item)
 Activate the item selected in the tree. 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
 
QPushButton * _qt_button
 
QHash< QAction *, int > _serials
 

Detailed Description

Definition at line 37 of file YQMenuButton.h.

Member Function Documentation

◆ activateItem()

void YQMenuButton::activateItem ( YMenuItem *  item)
virtual

Activate the item selected in the tree.

Can be used in tests to simulate user input.

Derived classes are required to implement this.

Definition at line 231 of file YQMenuButton.cc.

Here is the call graph for this function:

◆ preferredHeight()

int YQMenuButton::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

Definition at line 206 of file YQMenuButton.cc.

◆ preferredWidth()

int YQMenuButton::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

Definition at line 200 of file YQMenuButton.cc.

◆ rebuildMenuTree()

void YQMenuButton::rebuildMenuTree ( )
virtual

Rebuild the displayed menu tree from the internally stored YMenuItems.

Implemented from YMenuButton.

Definition at line 72 of file YQMenuButton.cc.

Here is the call graph for this function:

◆ setEnabled()

void YQMenuButton::setEnabled ( bool  enabled)
virtual

Set enabled / disabled state.

Reimplemented from YWidget.

Definition at line 193 of file YQMenuButton.cc.

◆ setLabel()

void YQMenuButton::setLabel ( const std::string &  label)
virtual

Change the label on the button.

Reimplemented from YMenuButton / YSelectionWidget.

Definition at line 64 of file YQMenuButton.cc.

◆ setSize()

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

Set the new size of the widget.

Reimplemented from YWidget.

Definition at line 213 of file YQMenuButton.cc.


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