#include <ToolBar.h>

Public Member Functions | |
| virtual MenuBar * | getMenuBar () const =0 |
| virtual void | addButton (QAction *pAction, QAction *pBefore=NULL)=0 |
| virtual void | addButton (QAction *pAction, const std::string &shortcutContext, QAction *pBefore=NULL)=0 |
| virtual QAction * | insertWidget (QWidget *pWidget, QAction *pBefore=NULL)=0 |
| virtual QAction * | addSeparator (QAction *pBefore=NULL)=0 |
| virtual std::vector< QAction * > | getItems () const =0 |
| virtual void | removeItem (QAction *pAction)=0 |
| virtual void | show ()=0 |
| virtual void | hide ()=0 |
| virtual bool | isShown () const =0 |
Static Public Member Functions | |
| static const std::string & | signalShown () |
| static const std::string & | signalHidden () |
Protected Member Functions | |
| virtual | ~ToolBar () |
Each toolbar contains a menu bar as the first widget in the toolbar in which command actions can be added that relate to the other widgets and buttons on the toolbar.
This class provides a means for objects to add and remove buttons and other widgets from toolbars displayed in the main application window. The location of the button or widget can also be specified relative to the other buttons and widgets on the toolbar.
This subclass of Subject will notify upon the following conditions:
Definition at line 41 of file ToolBar.h.
| virtual ToolBar::~ToolBar | ( | ) | [protected, virtual] |
This should be destroyed by calling DesktopServices::deleteWindow.
| static const std::string& ToolBar::signalShown | ( | ) | [static] |
| static const std::string& ToolBar::signalHidden | ( | ) | [static] |
| virtual MenuBar* ToolBar::getMenuBar | ( | ) | const [pure virtual] |
Returns the menu bar associated with this toolbar.
| virtual void ToolBar::addButton | ( | QAction * | pAction, | |
| QAction * | pBefore = NULL | |||
| ) | [pure virtual] |
Adds the button to the toolbar.
This method adds a button to the toolbar based on the given action. The object calling this method is responsible for setting the icon and any other associated properties with the action and also any necessary connections to slot methods.
The button is added directly to the toolbar and the user will not be able to edit and save a keyboard shortcut in the user-defined configuration settings. To allow the user to edit the keyboard shortcut, call the overloaded addButton(QAction*, const std::string&, QAction*) method or call DesktopServices::initializeAction() prior to calling this method.
| pAction | The action to add to the toolbar as a button. | |
| pBefore | The button or widget that should immediately follow the added button. The button is added at the end of the toolbar if NULL is passed in or if the given action does not exist on the toolbar. |
| virtual void ToolBar::addButton | ( | QAction * | pAction, | |
| const std::string & | shortcutContext, | |||
| QAction * | pBefore = NULL | |||
| ) | [pure virtual] |
Adds the button to the toolbar.
This method adds a button to the toolbar based on the given action and allows the user to edit and save a keyboard shortcut based on the given context. If the user should not be able to edit the shortcut, call the overloaded addButton(QAction*, QAction*) method instead.
The object calling this method is responsible for setting the icon and any other associated properties with the action and also any necessary connections to slot methods.
| pAction | The action to add to the toolbar as a button. | |
| shortcutContext | The context name for the keyboard shortcut of the action. When the user edits keyboard shortcuts, the shortcuts are grouped according to their context string. Contexts can be nested by using a slash (/) between context levels. If the top-level context name is the same as a plug-in name, the shortcut is grouped under a single Plug-Ins context. Passing in an empty string indicates that the user should not be able to edit the keyboard shortcut of the command, which is the same as calling the overloaded addButton(QAction*, QAction*) method. | |
| pBefore | The button or widget that should immediately follow the added button. The button is added at the end of the toolbar if NULL is passed in or if the given action does not exist on the toolbar. |
| virtual QAction* ToolBar::insertWidget | ( | QWidget * | pWidget, | |
| QAction * | pBefore = NULL | |||
| ) | [pure virtual] |
Adds an existing widget to the toolbar.
| pWidget | The widget to add to the toolbar. | |
| pBefore | The button or widget that should immediately follow the added widget. The separator is added at the end of the toolbar if NULL is passed in or if the given action does not exist on the toolbar. |
| virtual QAction* ToolBar::addSeparator | ( | QAction * | pBefore = NULL |
) | [pure virtual] |
Adds a separator to the toolbar.
This method creates a separator widget on the toolbar to separate buttons into groups.
| pBefore | The button or widget that should immediately follow the added separator. The separator is added at the end of the toolbar if NULL is passed in or if the given action does not exist on the toolbar. |
| virtual std::vector<QAction*> ToolBar::getItems | ( | ) | const [pure virtual] |
Returns all buttons and widgets on the toolbar as actions.
| virtual void ToolBar::removeItem | ( | QAction * | pAction | ) | [pure virtual] |
Removes a button or widget from the toolbar.
This method removes the button or widget defined by the given action from the toolbar. The action is not deleted.
| pAction | The action defining the button or widget to remove from the toolbar. |
| virtual void ToolBar::show | ( | ) | [pure virtual] |
Shows the toolbar.
This method will display the toolbar only if it's hidden. If the toolbar already shown, this method will do nothing.
| virtual void ToolBar::hide | ( | ) | [pure virtual] |
Hides the toolbar.
This method will hide the toolbar only if it's shown. If the toolbar already hidden, this method will do nothing.
| virtual bool ToolBar::isShown | ( | ) | const [pure virtual] |
This method will return the current visiblity state of the toolbar.
true if the toolbar is shown or false if the toolbar is hidden.