HyperspaceExplorer 0.7.1
Public Slots | Public Member Functions | Private Attributes

#include <SlotHelper.h>

Collaboration diagram for SlotHelper:
Collaboration graph
[legend]

List of all members.

Public Slots

void slot ()

Public Member Functions

 SlotHelper (C4DView *view, const std::string &displayable_name)
 Construction.
virtual ~SlotHelper ()
 Cleanup.

Private Attributes

C4DViewview_
 The C4DView which wants to instantiate Function's.
std::string displayable_name_
 The name of the Displayable as taken by the FunctionFactory.

Detailed Description

Single-stop slot for menu QActions generating Displayable objects Your mission, should you choose to accept it, is to have a single function to serve as slot for all menu Actions which generate a new Displayable. After all, this could be done with a template.

In fact, it's not quite so easy and we need an indirection. Because moc can't compile class templates, we need another class to stand between the QAction triggered by (e.g.) menu item selection and the creation of a Function object.

This class provides a single slot, which calls the factory method of the FunctionFactory that was passed to the SlotHelper object during construction.

This way, a single slot function can create all Function objects. The drawback is that now many SlotHelper objects exist, one for every type of Function that is present in the menus.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:18 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo