![]() |
Sayonara Player
|
#include <MenuTool.h>
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_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 |
Protected Attributes | |
Settings * | _settings =nullptr |
ContextMenuEntries MenuToolButton::get_entries | ( | ) | const |
get current visible entries in menu
calls ContextMenu::get_entries()
void MenuToolButton::register_action | ( | QAction * | action | ) |
Use this to add custom actions.
action | a custom action |
void MenuToolButton::register_preference_action | ( | PreferenceAction * | action | ) |
Use this to add a preference Action.
PreferenceAction | for accessing preference dialog |
|
slot |
show/hide an action calls ContextMenu::show_action(ContextMenu::Entry entry, bool visible)
entry | the entry of interes |
visible | show/hide the action |
|
slot |
shows all actions specified in options. Hide every other action
calls ContextMenu::show_actions(ContextMenuEntries options)
options | option mask |