Developer Documentation
WhatsThisGenerator Class Reference

a class which provides an link generator for WhatsThisMessages linking to the user doc If you have an QAction pointer called action, you can call: More...

#include <OpenFlipper/BasePlugin/WhatsThisGenerator.hh>

Inheritance diagram for WhatsThisGenerator:

Public Member Functions

 WhatsThisGenerator (const QString &_plugin_name)
 
QString generateLink (const QString &_ref="", const QString &_site="index.html") const
 generates a clickable link to the documentation for whatsThis Messages More...
 
void setWhatsThis (QAction *_action, const QString &_msg, const QString &_ref="", const QString &_site="index.html") const
 sets a whatsThis Message plus link to the doc for the given QAction More...
 

Private Attributes

const QString plugin_name_
 

Detailed Description

a class which provides an link generator for WhatsThisMessages linking to the user doc If you have an QAction pointer called action, you can call:

action->setWhatsThis("Hello");

This message "Hello" will be shown when somebody call this action in WhatsThisMode.

WhatsThisGenerator provides functions linking to the user documentation. e.g. assume that whatsThisGen is a valid WhatsThisGenerator object

action->setWhatsThis(QString(tr("Hello"))+whatsThisGen.generateLink());

The code above will change the output for WhatsThisMessages to: "Hello Click here for more information" where "Click here for more information" is a link which will call the index.html (default parameter) of the plugin which you have to specify in the constructor of WhatsThisGenerator.

You can also use the WhatsThisGenerator to set the WhatsThisMessage:

whatsThisGen.setWHatsThis(action,tr("Hello"));

It has the same effect and options like the code above and is shorter.

Definition at line 65 of file WhatsThisGenerator.hh.

Constructor & Destructor Documentation

◆ WhatsThisGenerator()

WhatsThisGenerator::WhatsThisGenerator ( const QString &  _plugin_name)
explicit

Constructor for the whatsThisGenerator initializing the plugin name.

Parameters
_plugin_namethe name of the plugin which is used
Note
use only the name and NOT the prefix Plugin- (e.g. SkeletonEditing for Plugin-SkeletonEditing). If you want to reference in the core user plugin, then _plugin = "user"

Definition at line 50 of file WhatsThisGenerator.cc.

Member Function Documentation

◆ generateLink()

QString WhatsThisGenerator::generateLink ( const QString &  _ref = "",
const QString &  _site = "index.html" 
) const

generates a clickable link to the documentation for whatsThis Messages

Parameters
_refgives the section in the documentation for the action. The help-browser will jump into the section. An example: _jump = "Cube" in PrimitiveGenerator refs to the section "Cube" in the Documentation and the help Browser.
Note
use the doxygen reference name (always one word), not the section name
Parameters
_sitegives the documentation site (html-site) which you want to open. Default is the site "index.html". You need this parameter if you have more than one site in your plugin documentation and want to refer on one of this.

Definition at line 65 of file WhatsThisGenerator.cc.

◆ setWhatsThis()

void WhatsThisGenerator::setWhatsThis ( QAction *  _action,
const QString &  _msg,
const QString &  _ref = "",
const QString &  _site = "index.html" 
) const

sets a whatsThis Message plus link to the doc for the given QAction

Parameters
_actionaction where the message should appear.
_msghelp message for the user. This is the default Whatsthis Text which you set with QAction::setWhatsThis
_refgives the section in the documentation for the action. The help-browser will jump into the section. An example: _jump = "Cube" in PrimitiveGenerator refs to the section "Cube" in the Documentation and the help Browser.
Note
use the doxygen reference name (always one word), not the section name
Parameters
_sitegives the documentation site (html-site) which you want to open. Default is the site "index.html". You need this parameter if you have more than one site in your plugin documentation and want to refer on one of this.

Definition at line 89 of file WhatsThisGenerator.cc.


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