ToolButton

Inherited: AbstractButton

Description

The ToolButton class provides a UI component with a button-like appearance and an associated popup menu. It extends the functionality of AbstractButton to handle menu-related features. Users can show and hide the menu associated with the ToolButton, and the class also provides functionality to update the button text based on menu selections.

Public Methods

void

hideMenu ()

Menu *

menu () const

void

setMenu (Menu * menu)

void

showMenu ()

Static Methods

None

Methods Description

void ToolButton::hideMenu ()

Hides the associated popup menu.


:ref:`Menu<api_Menu>`* ToolButton::menu () const

Returns the associated menu, or nullptr if no menu has been defined.

See also setMenu().


void ToolButton::setMenu (Menu * menu)

Associates the given menu with this tool button. Ownership of the menu is not transferred to the tool button.

See also *menu*().


void ToolButton::showMenu ()

Shows the associated popup menu. Does nothing if no menu is associated.