Sayonara Player
Signals | Public Member Functions | Public Slots | Protected Member Functions | List of all members
MenuToolButton Class Reference

#include <MenuTool.h>

Detailed Description

This is the little button you often see near comboboxes
It opens up a menu when clicked. The actions in the menu a configurable.

Signals

void sig_open ()
 
void sig_new ()
 
void sig_undo ()
 
void sig_save ()
 
void sig_save_as ()
 
void sig_rename ()
 
void sig_delete ()
 
void sig_edit ()
 
void sig_default ()
 
void sig_triggered (QPoint)
 

Public Member Functions

 MenuToolButton (QWidget *parent=nullptr)
 
void register_action (QAction *action)
 Use this to add custom actions. More...
 
void register_preference_action (PreferenceAction *action)
 Use this to add a preference Action. More...
 
ContextMenuEntries get_entries () const
 get current visible entries in menu
calls ContextMenu::get_entries() More...
 
virtual void showEvent (QShowEvent *e) override
 

Public Slots

void show_action (ContextMenu::Entry entry, bool visible)
 show/hide an action calls ContextMenu::show_action(ContextMenu::Entry entry, bool visible) More...
 
void show_actions (ContextMenuEntries options)
 shows all actions specified in options. Hide every other action
calls ContextMenu::show_actions(ContextMenuEntries options) More...
 
void show_all ()
 show all actions
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *e) override
 
void skin_changed () override
 
void language_changed () override
 

Member Function Documentation

◆ get_entries()

ContextMenuEntries MenuToolButton::get_entries ( ) const

get current visible entries in menu
calls ContextMenu::get_entries()

Returns
a mask indicating which entries are shown. See ContextMenu::Entry

◆ register_action()

void MenuToolButton::register_action ( QAction *  action)

Use this to add custom actions.

Parameters
actiona custom action

◆ register_preference_action()

void MenuToolButton::register_preference_action ( PreferenceAction action)

Use this to add a preference Action.

Parameters
PreferenceActionfor accessing preference dialog

◆ show_action

void MenuToolButton::show_action ( ContextMenu::Entry  entry,
bool  visible 
)
slot

show/hide an action calls ContextMenu::show_action(ContextMenu::Entry entry, bool visible)

Parameters
entrythe entry of interes
visibleshow/hide the action

◆ show_actions

void MenuToolButton::show_actions ( ContextMenuEntries  options)
slot

shows all actions specified in options. Hide every other action
calls ContextMenu::show_actions(ContextMenuEntries options)

Parameters
optionsoption mask
Inheritance diagram for MenuToolButton:
MenuButton Gui::WidgetTemplate< QPushButton > Gui::WidgetTemplateParent