Drake Designer
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
ddViewMenu Class Reference

#include <src/app/ddViewMenu.h>

Inheritance diagram for ddViewMenu:
Inheritance graph
[legend]

Public Member Functions

 ddViewMenu (QMenu &menu, QObject *p=0)
 
 ~ddViewMenu ()
 
virtual bool eventFilter (QObject *watched, QEvent *e)
 
void addWidget (QWidget *widget, const QString &text, const QIcon &icon=QIcon())
 
void addWidget (QWidget *widget, QAction *action)
 
void addSeparator ()
 
void removeWidget (QWidget *widget)
 
int getNumberOfWidgets () const
 

Detailed Description

Manages a menu containing a collection of widgets that can be shown/hidden.

Definition at line 47 of file ddViewMenu.h.

Constructor & Destructor Documentation

ddViewMenu::ddViewMenu ( QMenu &  menu,
QObject *  p = 0 
)
ddViewMenu::~ddViewMenu ( )

Member Function Documentation

void ddViewMenu::addSeparator ( )

Add a separator to the view menu.

void ddViewMenu::addWidget ( QWidget *  widget,
const QString &  text,
const QIcon &  icon = QIcon() 
)

Adds a menu item for the widget to the view menu.

Pass in a null icon if there is no icon for the widget. The text can be the window title for the dock window. The text can also include a menu shortcut key.

Parameters
widgetThe widget to add.
iconAn icon to display in the menu.
textThe text to display in the menu.
void ddViewMenu::addWidget ( QWidget *  widget,
QAction *  action 
)
virtual bool ddViewMenu::eventFilter ( QObject *  watched,
QEvent *  e 
)
virtual

Used to watch for show and hide events.

The show and hide events for widgets are used to update the action associated with them in the view menu.

Parameters
watchedThe widget receiving the event.
eThe event that is about to be sent.
Returns
True if the event should be filtered out.
int ddViewMenu::getNumberOfWidgets ( ) const
void ddViewMenu::removeWidget ( QWidget *  widget)

Removes the widget from the view menu.

Parameters
widgetThe widget to remove.

The documentation for this class was generated from the following file: