kwave
18.07.70
|
#include <MenuRoot.h>
Public Member Functions | |
MenuRoot (QMenuBar &bar) | |
virtual | ~MenuRoot () Q_DECL_OVERRIDE |
virtual void | insertNode (const QString &name, const QString &position, const QString &command, const QKeySequence &shortcut, const QString &uid) Q_DECL_OVERRIDE |
virtual Kwave::MenuSub * | insertBranch (const QString &name, const QString &command, const QKeySequence &shortcut, const QString &uid) Q_DECL_OVERRIDE |
virtual Kwave::MenuNode * | insertLeaf (const QString &name, const QString &command, const QKeySequence &shortcut, const QString &uid) Q_DECL_OVERRIDE |
virtual void | removeChild (Kwave::MenuNode *child) Q_DECL_OVERRIDE |
virtual bool | specialCommand (const QString &command) Q_DECL_OVERRIDE |
virtual QHash< QString, Kwave::MenuGroup * > & | groupList () Q_DECL_OVERRIDE |
![]() | |
MenuNode (Kwave::MenuNode *parent, const QString &name, const QString &command, const QKeySequence &shortcut, const QString &uid) | |
virtual | ~MenuNode () |
const QString | path () const |
const QString & | name () const |
const QString & | command () const |
virtual QAction * | action () |
const QString & | uid () const |
void | setUID (const QString &uid) |
const QKeySequence & | shortcut () const |
virtual void | setShortcut (const QKeySequence &shortcut) |
virtual const QIcon | icon () |
virtual void | setIcon (const QIcon &icon) |
virtual bool | isBranch () const |
virtual void | clear () |
virtual Kwave::MenuNode * | parentNode () const |
virtual void | setVisible (bool visible) |
virtual bool | isEnabled () |
virtual void | setEnabled (bool enable) |
virtual void | setChecked (bool check) |
virtual void | setText (const QString &text) |
Kwave::MenuNode * | findUID (const QString &uid) |
Kwave::MenuNode * | findChild (const QString &name) |
virtual void | insertChild (Kwave::MenuNode *node, Kwave::MenuNode *before) |
virtual Kwave::MenuNode * | leafToBranch (Kwave::MenuNode *node) |
virtual void | actionSelected () |
void | joinGroup (const QString &group, Kwave::MenuGroup::Mode mode) |
void | leaveGroup (const QString &group) |
Static Public Member Functions | |
static void | deleteLater (Kwave::MenuNode *node) |
Protected Member Functions | |
void | showChild (Kwave::MenuSub *child) |
void | hideChild (Kwave::MenuSub *child) |
![]() | |
Kwave::MenuNode * | rootNode () |
void | emitCommand (const QString &command) |
Private Attributes | |
QMenuBar & | m_menu_bar |
QHash< QString, Kwave::MenuGroup * > | m_group_list |
Static Private Attributes | |
static QList< Kwave::MenuNode * > | m_garbage |
Friends | |
class | MenuSub |
Additional Inherited Members | |
![]() | |
void | sigCommand (const QString &command) |
![]() | |
QList< Kwave::MenuNode * > | m_children |
QStringList | m_groups |
This is the class for the root of a Menu (e.g. a MenuBar) that contains all toplevel menus of a menu hierarchy.
Definition at line 39 of file MenuRoot.h.
|
explicit |
Constructor.
bar | reference to a QMenuBar |
Definition at line 38 of file MenuRoot.cpp.
|
virtual |
Destructor
Definition at line 45 of file MenuRoot.cpp.
References Kwave::MenuNode::clear().
|
static |
replacement for QObject::deleteLater(...), which does not work in this context
Definition at line 177 of file MenuRoot.cpp.
References m_garbage.
Referenced by Kwave::MenuNode::leafToBranch().
|
virtual |
Returns a pointer to the list of groups
Reimplemented from Kwave::MenuNode.
Definition at line 51 of file MenuRoot.cpp.
References m_group_list.
Referenced by hideChild(), removeChild(), Kwave::MenuManager::selectItem(), Kwave::MenuManager::setItemEnabled(), and showChild().
|
protected |
Makes a child node invisible, by removing it from the menu bar
child | pointer to the child node (normally a MenuSub) |
Definition at line 110 of file MenuRoot.cpp.
References Kwave::MenuNode::action(), Kwave::MenuSub::action(), groupList(), Kwave::MenuNode::m_children, m_menu_bar, and Kwave::MenuNode::name().
Referenced by Kwave::MenuSub::setVisible().
|
virtual |
Inserts a new branch node into the menu structure.
name | non-localized name of the node |
command | the command template used for creating commands of submenus (leafes) that don't have an own command but contain data for their parent's command. Should contain a s that will be replaced by some data from a child entry. (this is used for menus with data selection lists like "recent files) If not used, pass 0. |
shortcut | keyboard shortcut, 0 if unused |
uid | unique id string (might be 0) |
Reimplemented from Kwave::MenuNode.
Definition at line 73 of file MenuRoot.cpp.
References Kwave::MenuNode::insertChild(), and m_menu_bar.
|
virtual |
Inserts a new leaf node into the menu structure. The new node normally is (derived from) MenuItem.
name | non-localized name of the node |
command | the command to be sent when the node is selected (might be 0) |
shortcut | keyboard shortcut, 0 if unused |
uid | unique id string (might be 0) |
Reimplemented from Kwave::MenuNode.
Definition at line 93 of file MenuRoot.cpp.
References Kwave::MenuItem::action(), Kwave::MenuNode::insertChild(), and m_menu_bar.
|
virtual |
overloaded version from MenuNode, which does a cleanup of the "garbage collector" afterwards.
name | non-localized name of the first node (might be 0) |
position | path consiting of several node names separated by a '/'. All strings are non-localized. |
command | the command to be sent when the node is selected (might be 0) |
shortcut | keyboard shortcut, 0 if unused |
uid | unique id string (might be 0) |
Reimplemented from Kwave::MenuNode.
Definition at line 57 of file MenuRoot.cpp.
References Kwave::MenuNode::insertNode(), and m_garbage.
Referenced by Kwave::MenuManager::executeCommand().
|
virtual |
Removes a child node of the current node. If the child was not found or is already removed this does nothing.
child | pointer to the child node |
Reimplemented from Kwave::MenuNode.
Definition at line 146 of file MenuRoot.cpp.
References Kwave::MenuNode::action(), groupList(), Kwave::MenuNode::m_children, m_menu_bar, Kwave::MenuNode::name(), and Kwave::MenuNode::removeChild().
|
protected |
Makes a child node visible, by adding it to the menu bar
child | pointer to the child node (normally a MenuSub) |
Definition at line 122 of file MenuRoot.cpp.
References Kwave::MenuNode::action(), groupList(), Kwave::MenuNode::m_children, m_menu_bar, Kwave::MenuSub::menu(), and Kwave::MenuNode::name().
Referenced by Kwave::MenuSub::setVisible().
|
virtual |
Handles/interprets special menu commands.
command | name of a menu node or command |
Reimplemented from Kwave::MenuNode.
Definition at line 163 of file MenuRoot.cpp.
References _, m_menu_bar, and Kwave::MenuNode::specialCommand().
|
friend |
Definition at line 135 of file MenuRoot.h.
|
staticprivate |
list of nodes to delete, as deleteLater() does not work :-(
garbage collector for menu nodes
Definition at line 158 of file MenuRoot.h.
Referenced by deleteLater(), and insertNode().
|
private |
|
private |
reference to a QMenuBar
Definition at line 152 of file MenuRoot.h.
Referenced by hideChild(), insertBranch(), insertLeaf(), removeChild(), showChild(), and specialCommand().