kwave
18.07.70
|
#include <MenuSub.h>
Public Member Functions | |
MenuSub (Kwave::MenuNode *parent, QMenu *menu, const QString &name, const QString &command, const QKeySequence &shortcut, const QString &uid) | |
virtual | ~MenuSub () Q_DECL_OVERRIDE |
virtual bool | isBranch () const 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 QAction * | action () Q_DECL_OVERRIDE |
virtual void | removeChild (Kwave::MenuNode *child) Q_DECL_OVERRIDE |
virtual bool | specialCommand (const QString &command) Q_DECL_OVERRIDE |
virtual void | setVisible (bool visible) Q_DECL_OVERRIDE |
virtual bool | isEnabled () Q_DECL_OVERRIDE |
virtual void | setEnabled (bool enable) Q_DECL_OVERRIDE |
virtual const QIcon | icon () Q_DECL_OVERRIDE |
virtual void | setIcon (const QIcon &icon) 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 |
const QString & | uid () const |
void | setUID (const QString &uid) |
const QKeySequence & | shortcut () const |
virtual void | setShortcut (const QKeySequence &shortcut) |
virtual void | clear () |
virtual Kwave::MenuNode * | parentNode () const |
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 void | insertNode (const QString &name, const QString &position, const QString &command, const QKeySequence &shortcut, const QString &uid) |
virtual Kwave::MenuNode * | leafToBranch (Kwave::MenuNode *node) |
virtual void | actionSelected () |
virtual QHash< QString, Kwave::MenuGroup * > & | groupList () |
void | joinGroup (const QString &group, Kwave::MenuGroup::Mode mode) |
void | leaveGroup (const QString &group) |
Protected Member Functions | |
virtual QMenu * | menu () |
![]() | |
Kwave::MenuNode * | rootNode () |
void | emitCommand (const QString &command) |
Private Attributes | |
QMenu * | m_menu |
Friends | |
class | MenuRoot |
Additional Inherited Members | |
![]() | |
void | sigCommand (const QString &command) |
![]() | |
QList< Kwave::MenuNode * > | m_children |
QStringList | m_groups |
This is the class for submenu entries in a Menu. It is normally owned by a root menu node, a toplevel menu or another submenu.
Kwave::MenuSub::MenuSub | ( | Kwave::MenuNode * | parent, |
QMenu * | menu, | ||
const QString & | name, | ||
const QString & | command, | ||
const QKeySequence & | shortcut, | ||
const QString & | uid | ||
) |
Constructor.
parent | pointer to the node's parent (might be 0) |
menu | the already generated QMenu |
name | the non-localized name of the submenu |
command | the command to be sent when the submenu is selected (optional, default=0) |
shortcut | keyboard shortcut, (optional, default=0) |
uid | unique id string (optional, default=0) |
Definition at line 33 of file MenuSub.cpp.
References _, action(), Kwave::MenuNode::path(), and UTF8.
|
virtual |
|
inlinevirtual |
Returns the corresponding menu action
Reimplemented from Kwave::MenuNode.
Definition at line 102 of file MenuSub.h.
References icon(), isEnabled(), m_menu, removeChild(), setEnabled(), setIcon(), setVisible(), and specialCommand().
Referenced by Kwave::MenuRoot::hideChild(), and MenuSub().
|
virtual |
Returns the menu nodes' icon.
Reimplemented from Kwave::MenuNode.
Definition at line 86 of file MenuSub.cpp.
References m_menu.
Referenced by action().
|
virtual |
Inserts a new branch node under the submenu. The new node normally is (derived from) MenuSub.
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 98 of file MenuSub.cpp.
References Kwave::MenuNode::insertChild(), m_menu, and menu().
Referenced by isBranch().
|
virtual |
Inserts a new leaf node under the submenu. 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 118 of file MenuSub.cpp.
References Kwave::MenuNode::action(), Kwave::MenuItem::action(), Kwave::MenuNode::insertChild(), Kwave::MenuNode::m_children, m_menu, Kwave::MenuNode::name(), and Kwave::MenuNode::uid().
Referenced by isBranch().
|
inlinevirtual |
Always returns true, as the nodes of this type are branches.
Reimplemented from Kwave::MenuNode.
Definition at line 64 of file MenuSub.h.
References insertBranch(), and insertLeaf().
|
virtual |
Returns true if the node is enabled.
Reimplemented from Kwave::MenuNode.
Definition at line 73 of file MenuSub.cpp.
References Kwave::MenuNode::isEnabled(), and m_menu.
Referenced by action().
|
inlineprotectedvirtual |
return the pointer to our QMenu
Definition at line 150 of file MenuSub.h.
References m_menu.
Referenced by insertBranch(), and Kwave::MenuRoot::showChild().
|
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 163 of file MenuSub.cpp.
References Kwave::MenuNode::action(), m_menu, and Kwave::MenuNode::removeChild().
Referenced by action().
|
virtual |
Enables/disables the current menu node.
enable | true to enable the item, false to disable |
Reimplemented from Kwave::MenuNode.
Definition at line 80 of file MenuSub.cpp.
References m_menu.
Referenced by action(), and Kwave::MenuNode::leafToBranch().
|
virtual |
Sets a new icon of a menu node.
icon | QPixmap with the icon |
Reimplemented from Kwave::MenuNode.
Definition at line 92 of file MenuSub.cpp.
References m_menu.
Referenced by action(), and Kwave::MenuNode::leafToBranch().
|
virtual |
Shows/hides the current sub menu.
visible | true to show the sub menu, false to hide |
Reimplemented from Kwave::MenuNode.
Definition at line 52 of file MenuSub.cpp.
References Kwave::MenuRoot::hideChild(), m_menu, Kwave::MenuNode::parentNode(), Kwave::MenuNode::rootNode(), and Kwave::MenuRoot::showChild().
Referenced by action().
|
virtual |
Handles/interpretes special menu commands.
command | name of a menu node or command |
Reimplemented from Kwave::MenuNode.
Definition at line 172 of file MenuSub.cpp.
References _, m_menu, and Kwave::MenuNode::specialCommand().
Referenced by action().
|
private |
the QMenu that is controlled
Definition at line 155 of file MenuSub.h.
Referenced by action(), icon(), insertBranch(), insertLeaf(), isEnabled(), menu(), removeChild(), setEnabled(), setIcon(), setVisible(), and specialCommand().