FreeCAD C++
Public Member Functions | Protected Attributes | List of all members
Gui::CommandBase Class Referenceabstract

#include <Gui/Command.h>

Detailed Description

The CommandBase class This lightweight class is the base class of all commands in FreeCAD. It represents the link between the FreeCAD command framework and the QAction world of Qt.

Author
Werner Mayer

Public Member Functions

ActiongetAction () const
 
Methods to get the properties of the command
virtual const char * getMenuText () const
 
virtual const char * getToolTipText () const
 
virtual const char * getStatusTip () const
 
virtual const char * getWhatsThis () const
 
virtual const char * getPixmap () const
 
virtual const char * getAccel () const
 
Methods to set the properties of the command
void setWhatsThis (const char *)
 
void setMenuText (const char *)
 
void setToolTipText (const char *)
 
void setStatusTip (const char *)
 
void setPixmap (const char *)
 
void setAccel (const char *)
 

Protected Attributes

Action_pcAction
 
Attributes set by the inherited constructor.

They set up the most important properties of the command. In the constructor are set default values. The real values should be set in the constructor of the inheriting class.

const char * sMenuText
 
const char * sToolTipText
 
const char * sWhatsThis
 
const char * sStatusTip
 
const char * sPixmap
 
const char * sAccel
 

Methods to override when creating a new command

virtual ActioncreateAction (void)
 Creates the used Action when adding to a widget. The default implementation does nothing.
 
virtual void languageChange ()=0
 Reassigns QAction stuff after the language has changed.
 
virtual void updateAction (int mode)=0
 Updates the QAction with respect to the passed mode.
 
virtual const char * className () const =0
 The C++ class name is needed as context for the translation framework.
 

Member Function Documentation

◆ getAction()

Action* Gui::CommandBase::getAction ( ) const

Returns the Action object of this command, or 0 if it doesn't exist.

Member Data Documentation

◆ _pcAction

Action* Gui::CommandBase::_pcAction
protected

The Action item.