![]() |
VR-Forces 4.0.4 Class Documentation
|
A tree widget that will allow the addition of menu items that will appear on a context menu when the right mouse button is clicked on an item. More...

Classes | |
| class | ContextMenuItem |
Public Types | |
| typedef std::vector < ContextMenuItem > | DtContextMenuItems |
Public Member Functions | |
| DtContextTreeWidget (QWidget *parent=0) | |
| virtual | ~DtContextTreeWidget () |
| virtual void | addContextItem (QPushButton *b, QObject *receiver, const char *slot) |
| context menu, connecting it to the specified object and slot when the item is triggered. | |
| virtual void | addContextItem (QPushButton *b, const QString &title, QObject *receiver, const char *slot) |
| virtual void | addContextItem (const QString &item, QObject *receiver, const char *slot, const QIcon &icon=QIcon()) |
| Adds a context menu item given the text, icon and receive, slot. | |
| virtual void | addContextSeparator () |
| Adds a separator to the menu. | |
| const DtContextMenuItems & | menuItems () const |
| Returns the list of actions to be created. | |
| virtual void | setMenuItems (const DtContextMenuItems &) |
| virtual void | removeMenuItem (const QString &) |
| Removes the menu item with the given name. | |
| virtual void | removeSeparator (int at=1) |
| Removes the nth separator. | |
| bool | rightClick () const |
Public Attributes | |
| boost::signal< void(DtContextTreeWidget *, QMenu *)> | signal_contextMenuAboutToBeShown |
| Signal emitted before the menu is shown. | |
Protected Slots | |
| virtual void | onButtonDestroyed () |
Protected Member Functions | |
| virtual void | processContextMenu (const QPoint &) |
| Creates and displays context menu at the specified position. | |
| virtual void | mousePressEvent (QMouseEvent *mouseEvent) |
| virtual void | mouseReleaseEvent (QMouseEvent *mouseEvent) |
| virtual void | deleteIfOwned (const ContextMenuItem &) |
| Delete if menu button is owned by this context tree. | |
Protected Attributes | |
| bool | myRightClick |
| DtContextMenuItems | myMenuItems |
A tree widget that will allow the addition of menu items that will appear on a context menu when the right mouse button is clicked on an item.
| typedef std::vector<ContextMenuItem> makVrv::DtContextTreeWidget::DtContextMenuItems |
| makVrv::DtContextTreeWidget::DtContextTreeWidget | ( | QWidget * | parent = 0 | ) |
| virtual makVrv::DtContextTreeWidget::~DtContextTreeWidget | ( | ) | [virtual] |
| virtual void makVrv::DtContextTreeWidget::addContextItem | ( | QPushButton * | b, |
| QObject * | receiver, | ||
| const char * | slot | ||
| ) | [virtual] |
context menu, connecting it to the specified object and slot when the item is triggered.
Will also connect to a "destroyed" signal of the button to remove it if the button is ever destroyed. Will enable/disable the menu item based on the enabled/disabled status of the button
| virtual void makVrv::DtContextTreeWidget::addContextItem | ( | QPushButton * | b, |
| const QString & | title, | ||
| QObject * | receiver, | ||
| const char * | slot | ||
| ) | [virtual] |
| virtual void makVrv::DtContextTreeWidget::addContextItem | ( | const QString & | item, |
| QObject * | receiver, | ||
| const char * | slot, | ||
| const QIcon & | icon = QIcon() |
||
| ) | [virtual] |
Adds a context menu item given the text, icon and receive, slot.
Will create a push button for it and call the addContextItemForButton method
| virtual void makVrv::DtContextTreeWidget::addContextSeparator | ( | ) | [virtual] |
Adds a separator to the menu.
| const DtContextMenuItems& makVrv::DtContextTreeWidget::menuItems | ( | ) | const |
Returns the list of actions to be created.
Modify the list and reset it to change possible menu contents
| virtual void makVrv::DtContextTreeWidget::setMenuItems | ( | const DtContextMenuItems & | ) | [virtual] |
| virtual void makVrv::DtContextTreeWidget::removeMenuItem | ( | const QString & | ) | [virtual] |
Removes the menu item with the given name.
Case sensitive, and, if there is an & (for underline) will also need to have that in the search string
| virtual void makVrv::DtContextTreeWidget::removeSeparator | ( | int | at = 1 | ) | [virtual] |
Removes the nth separator.
| bool makVrv::DtContextTreeWidget::rightClick | ( | ) | const [inline] |
| virtual void makVrv::DtContextTreeWidget::onButtonDestroyed | ( | ) | [protected, virtual, slot] |
| virtual void makVrv::DtContextTreeWidget::processContextMenu | ( | const QPoint & | ) | [protected, virtual] |
Creates and displays context menu at the specified position.
Will send signal before executing menu
| virtual void makVrv::DtContextTreeWidget::mousePressEvent | ( | QMouseEvent * | mouseEvent | ) | [protected, virtual] |
| virtual void makVrv::DtContextTreeWidget::mouseReleaseEvent | ( | QMouseEvent * | mouseEvent | ) | [protected, virtual] |
| virtual void makVrv::DtContextTreeWidget::deleteIfOwned | ( | const ContextMenuItem & | ) | [protected, virtual] |
Delete if menu button is owned by this context tree.
| boost::signal<void (DtContextTreeWidget*, QMenu*)> makVrv::DtContextTreeWidget::signal_contextMenuAboutToBeShown |
Signal emitted before the menu is shown.
Can be used for menu item validation
bool makVrv::DtContextTreeWidget::myRightClick [protected] |