Gui::ActionFunction Class Reference
#include <ActionFunction.h>
Public Member Functions | |
ActionFunction (QObject *) | |
Constructor. More... | |
void | hover (QAction *a, boost::function< void()> func) |
void | toggle (QAction *a, boost::function< void(bool)> func) |
void | trigger (QAction *a, boost::function< void()> func) |
virtual | ~ActionFunction () |
Detailed Description
The class connects the triggered() signal of a QAction instance with the method of a usual C++ class not derived from QObject.
The class can e.g be used to fill up the context-menu of the view provider classes.
{
func->triggered(a1, boost::bind(&MyViewProvider::doItem1, this));
func->triggered(a2, boost::bind(&MyViewProvider::doItem2, this));
func->triggered(a3, boost::bind(&MyViewProvider::doItem3, this));
}
http://www.boost.org/doc/libs/1_57_0/libs/bind/bind.html#with_boost_function
Constructor & Destructor Documentation
◆ ActionFunction()
ActionFunction::ActionFunction | ( | QObject * | parent | ) |
Constructor.
◆ ~ActionFunction()
|
virtual |
Member Function Documentation
◆ hover()
void ActionFunction::hover | ( | QAction * | a, |
boost::function< void()> | func | ||
) |
◆ toggle()
void ActionFunction::toggle | ( | QAction * | a, |
boost::function< void(bool)> | func | ||
) |
◆ trigger()
void ActionFunction::trigger | ( | QAction * | a, |
boost::function< void()> | func | ||
) |
Connects the QAction's triggered() signal with the function func
The documentation for this class was generated from the following files:
- src/Gui/ActionFunction.h
- src/Gui/ActionFunction.cpp
Definition: ActionFunction.h:64