graph_analysis
Public Member Functions | List of all members
graph_analysis::gui::ActionCommander Class Reference

Creates QAction-s and registers them with given slots of the supplied QObject. More...

#include <ActionCommander.hpp>

Public Member Functions

 ActionCommander (QObject *object)
 constructor; stores the QObject instance reference for qt signal-slot connections More...
 
 ~ActionCommander ()
 destructor More...
 
QAction * addAction (const char *title, const char *slot)
 creates and registers a basic action with the stored 'mpObject' qt object More...
 
QAction * addAction (const char *title, const char *slot, QObject *object)
 creates and registers a basic action with the provided 'object' instead of the mpObject member field More...
 
QAction * addAction (const char *title, const char *slot, const QIcon &icon)
 creates and registers a basic action with the stored 'mpObject' qt object More...
 
QAction * addAction (const char *title, const char *slot, const QIcon &icon, QObject *object)
 creates and registers a basic action with the provided 'object' instead of the mpObject member field More...
 
QAction * addAction (const char *title, const char *slot, const QIcon &icon, const QKeySequence &keySequence, const QString &statusTip=QString(), QObject *object=0)
 creates and registers a basic action with the provided 'object' instead of the mpObject member field More...
 
QAction * addMappedAction (const char *title, const char *slot, QObject *arg)
 creates and registers a complex action (with 1 parameter) with the stored 'mpObject' qt object More...
 
QAction * addMappedAction (const char *title, const char *slot, QObject *arg, QObject *object)
 creates and registers a complex action (with 1 parameter) with the provided 'object' instead of the mpObject member field More...
 
QAction * addMappedAction (const char *title, const char *slot, QObject *arg, const QIcon &icon)
 creates and registers a complex action (with 1 parameter) with the stored 'mpObject' qt object More...
 
QAction * addMappedAction (const char *title, const char *slot, QObject *arg, const QIcon &icon, QObject *object)
 creates and registers a complex action (with 1 parameter) with the provided 'object' instead of the mpObject member field More...
 

Detailed Description

Creates QAction-s and registers them with given slots of the supplied QObject.

used to partially automate the code refactoring for the QMenu construction at runtime

Constructor & Destructor Documentation

◆ ActionCommander()

graph_analysis::gui::ActionCommander::ActionCommander ( QObject *  object)

constructor; stores the QObject instance reference for qt signal-slot connections

◆ ~ActionCommander()

graph_analysis::gui::ActionCommander::~ActionCommander ( )

destructor

Member Function Documentation

◆ addAction() [1/5]

QAction * graph_analysis::gui::ActionCommander::addAction ( const char *  title,
const char *  slot 
)

creates and registers a basic action with the stored 'mpObject' qt object

Parameters
titletext to be displayed for this action
slotstring with the slot function name
Returns
pointer to the resulting QAction instance

◆ addAction() [2/5]

QAction * graph_analysis::gui::ActionCommander::addAction ( const char *  title,
const char *  slot,
QObject *  object 
)

creates and registers a basic action with the provided 'object' instead of the mpObject member field

Parameters
titletext to be displayed for this action
slotstring with the slot function name
objectqt object to register to
Returns
pointer to the resulting QAction instance

◆ addAction() [3/5]

QAction * graph_analysis::gui::ActionCommander::addAction ( const char *  title,
const char *  slot,
const QIcon &  icon 
)

creates and registers a basic action with the stored 'mpObject' qt object

Parameters
titletext to be displayed for this action
slotstring with the slot function name
iconsmall image to be displayed left of the action title
Returns
pointer to the resulting QAction instance

◆ addAction() [4/5]

QAction * graph_analysis::gui::ActionCommander::addAction ( const char *  title,
const char *  slot,
const QIcon &  icon,
QObject *  object 
)

creates and registers a basic action with the provided 'object' instead of the mpObject member field

Parameters
titletext to be displayed for this action
slotstring with the slot function name
iconsmall image to be displayed left of the action title
objectqt object to register to
Returns
pointer to the resulting QAction instance

◆ addAction() [5/5]

QAction * graph_analysis::gui::ActionCommander::addAction ( const char *  title,
const char *  slot,
const QIcon &  icon,
const QKeySequence &  keySequence,
const QString &  statusTip = QString(),
QObject *  object = 0 
)

creates and registers a basic action with the provided 'object' instead of the mpObject member field

Parameters
titletext to be displayed for this action
slotstring with the slot function name
iconsmall image to be displayed left of the action title
keySequenceSequence of keys to trigger this action
statusTipText that shows up as status tip
objectqt object to register to
Returns
pointer to the resulting QAction instance
See also
http://doc.qt.io/qt-4.8/qkeysequence.html

◆ addMappedAction() [1/4]

QAction * graph_analysis::gui::ActionCommander::addMappedAction ( const char *  title,
const char *  slot,
QObject *  arg 
)

creates and registers a complex action (with 1 parameter) with the stored 'mpObject' qt object

Parameters
titletext to be displayed for this action
slotstring with the slot function name
argpointer to the argument of this action (it has to be a subclass of QObject)
Returns
pointer to the resulting QAction instance

◆ addMappedAction() [2/4]

QAction * graph_analysis::gui::ActionCommander::addMappedAction ( const char *  title,
const char *  slot,
QObject *  arg,
QObject *  object 
)

creates and registers a complex action (with 1 parameter) with the provided 'object' instead of the mpObject member field

Parameters
titletext to be displayed for this action
slotstring with the slot function name
argpointer to the argument of this action (it has to be a subclass of QObject)
objectqt object to register to
Returns
pointer to the resulting QAction instance

◆ addMappedAction() [3/4]

QAction * graph_analysis::gui::ActionCommander::addMappedAction ( const char *  title,
const char *  slot,
QObject *  arg,
const QIcon &  icon 
)

creates and registers a complex action (with 1 parameter) with the stored 'mpObject' qt object

Parameters
titletext to be displayed for this action
slotstring with the slot function name
argpointer to the argument of this action (it has to be a subclass of QObject)
iconsmall image to be displayed left of the action title
Returns
pointer to the resulting QAction instance

◆ addMappedAction() [4/4]

QAction * graph_analysis::gui::ActionCommander::addMappedAction ( const char *  title,
const char *  slot,
QObject *  arg,
const QIcon &  icon,
QObject *  object 
)

creates and registers a complex action (with 1 parameter) with the provided 'object' instead of the mpObject member field

Parameters
titletext to be displayed for this action
slotstring with the slot function name
argpointer to the argument of this action (it has to be a subclass of QObject)
iconsmall image to be displayed left of the action title
objectqt object to register to
Returns
pointer to the resulting QAction instance

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