|
kwave
18.07.70
|
#include <MenuItem.h>


Public Member Functions | |
| MenuItem (Kwave::MenuNode *parent, const QString &name, const QString &command, const QKeySequence &shortcut, const QString &uid) | |
| virtual | ~MenuItem () Q_DECL_OVERRIDE |
| virtual void | actionSelected () 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 void | setCheckable (bool checkable) |
| virtual bool | isCheckable () |
| virtual void | setChecked (bool check) Q_DECL_OVERRIDE |
| virtual void | setText (const QString &text) Q_DECL_OVERRIDE |
| virtual const QIcon | icon () Q_DECL_OVERRIDE |
| virtual void | setIcon (const QIcon &icon) Q_DECL_OVERRIDE |
| virtual QAction * | action () Q_DECL_OVERRIDE |
Public Member Functions inherited from Kwave::MenuNode | |
| 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 bool | isBranch () const |
| virtual void | clear () |
| virtual Kwave::MenuNode * | parentNode () const |
| Kwave::MenuNode * | findUID (const QString &uid) |
| Kwave::MenuNode * | findChild (const QString &name) |
| virtual void | removeChild (Kwave::MenuNode *child) |
| virtual Kwave::MenuSub * | insertBranch (const QString &name, const QString &command, const QKeySequence &shortcut, const QString &uid) |
| virtual Kwave::MenuNode * | insertLeaf (const QString &name, const QString &command, const QKeySequence &shortcut, const QString &uid) |
| 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 QHash< QString, Kwave::MenuGroup * > & | groupList () |
| void | joinGroup (const QString &group, Kwave::MenuGroup::Mode mode) |
| void | leaveGroup (const QString &group) |
Private Slots | |
| virtual void | actionTriggered (bool checked) |
Private Attributes | |
| QString | m_exclusive_group |
| QAction | m_action |
Additional Inherited Members | |
Signals inherited from Kwave::MenuNode | |
| void | sigCommand (const QString &command) |
Protected Member Functions inherited from Kwave::MenuNode | |
| Kwave::MenuNode * | rootNode () |
| void | emitCommand (const QString &command) |
Protected Attributes inherited from Kwave::MenuNode | |
| QList< Kwave::MenuNode * > | m_children |
| QStringList | m_groups |
Base class for entries in a Menu. It is normally owned by a toplevel menu or a submenu.
Definition at line 35 of file MenuItem.h.
| Kwave::MenuItem::MenuItem | ( | Kwave::MenuNode * | parent, |
| const QString & | name, | ||
| const QString & | command, | ||
| const QKeySequence & | shortcut, | ||
| const QString & | uid | ||
| ) |
Constructor.
| parent | pointer to the node's parent (might be 0) |
| name | the non-localized name of the node |
| command | the command to be sent when the node is selected (optional, default=0) |
| shortcut | keyboard shortcut (optional, default=0) |
| uid | unique id string (optional, default=0) |
Definition at line 33 of file MenuItem.cpp.
References _, actionTriggered(), Kwave::connect(), m_action, Kwave::MenuNode::path(), and UTF8.

|
virtual |
|
inlinevirtual |
Returns the corresponding menu action
Reimplemented from Kwave::MenuNode.
Definition at line 122 of file MenuItem.h.
References actionTriggered(), and m_action.
Referenced by Kwave::MenuSub::insertLeaf(), and Kwave::MenuRoot::insertLeaf().


|
virtual |
Called to notify the item that it has been selected.
Reimplemented from Kwave::MenuNode.
Definition at line 64 of file MenuItem.cpp.
References Kwave::MenuNode::actionSelected(), isCheckable(), m_exclusive_group, and setChecked().
Referenced by actionTriggered().


|
privatevirtualslot |
Definition at line 57 of file MenuItem.cpp.
References actionSelected().
Referenced by action(), and MenuItem().


|
virtual |
Returns the menu nodes' icon.
Reimplemented from Kwave::MenuNode.
Definition at line 151 of file MenuItem.cpp.
References m_action.
|
virtual |
Returns true if the node is checkable/selectable
Definition at line 127 of file MenuItem.cpp.
References m_action.
Referenced by actionSelected().

|
virtual |
Returns true if the node is enabled.
Reimplemented from Kwave::MenuNode.
Definition at line 114 of file MenuItem.cpp.
References Kwave::MenuNode::isEnabled(), and m_action.

|
virtual |
Enables/disabled checking/selecting the item
| checkable | true to enable checking, false for disabling |
Definition at line 133 of file MenuItem.cpp.
References m_action.
Referenced by specialCommand().

|
virtual |
Sets/removes the checkmark from the current menu item.
| check | true to set the mark, false to remove |
Reimplemented from Kwave::MenuNode.
Definition at line 139 of file MenuItem.cpp.
References m_action.
Referenced by actionSelected().

|
virtual |
Enables/disables the current menu node.
| enable | true to enable the item, false to disable |
Reimplemented from Kwave::MenuNode.
Definition at line 121 of file MenuItem.cpp.
References m_action.
|
virtual |
Sets a new icon of a menu node.
| icon | QPixmap with the icon |
Reimplemented from Kwave::MenuNode.
Definition at line 157 of file MenuItem.cpp.
References m_action.
|
virtual |
Sets the visible text of an item to a new value. (Only useful for a MenuItem)
| text | the new text |
Reimplemented from Kwave::MenuNode.
Definition at line 145 of file MenuItem.cpp.
References m_action.
|
virtual |
Shows/hides the current menu node.
| visible | true to show the item, false to hide |
Reimplemented from Kwave::MenuNode.
Definition at line 108 of file MenuItem.cpp.
References m_action.
Referenced by specialCommand().

|
virtual |
Handles/interpretes special menu commands.
| command | name of a menu node or command |
Reimplemented from Kwave::MenuNode.
Definition at line 73 of file MenuItem.cpp.
References _, Kwave::Parser::command(), DBG, Kwave::MenuGroup::EXCLUSIVE, Kwave::Parser::firstParam(), Kwave::MenuNode::joinGroup(), m_exclusive_group, Kwave::MenuNode::name(), Kwave::Parser::nextParam(), setCheckable(), setVisible(), and Kwave::MenuNode::specialCommand().

|
private |
the QAction behind this menu entry
Definition at line 137 of file MenuItem.h.
Referenced by action(), icon(), isCheckable(), isEnabled(), MenuItem(), setCheckable(), setChecked(), setEnabled(), setIcon(), setText(), and setVisible().
|
private |
name of a group for exclusive selection (optional, set by special command, default=0)
Definition at line 134 of file MenuItem.h.
Referenced by actionSelected(), and specialCommand().