KTutorial
0.5.1
|
An option shown to the user. More...
#include <Option.h>
Signals | |
void | selected () |
This signal is emitted when this Option is selected by the user. | |
Public Member Functions | |
Option (const QString &name) | |
Creates a new Option with the specified name. | |
virtual | ~Option () |
Destroys this Option. | |
QString | name () const |
Returns the name of this Option. |
An option shown to the user.
An option is something a user can choose to do in a Step. For example, in the start step of a tutorial, if the user wants to follow the easy or the hard way. Two options would be used in that case, named "Easy" and "Hard".
Several options can be added in each Step of a Tutorial. When an Option is added, it is connected to a slot that is executed when the user selects that Option.
Step* startStep = new Step("start"); startStep->setText(i18nc("@info", "Do you want to follow the easy or the hard way of the tutorial?")); Option* easyWayOption = new Option(i18n("Easy")); startStep->addOption(easyWayOption, this, SLOT(startEasyOption())); Option* hardWayOption = new Option(i18n("Hard")); startStep->addOption(hardWayOption, this, SLOT(startHardOption()));
In order to use an Option, it is only needed to set its properties and specify a slot to be called when the user selects it.
ktutorial::Option::Option | ( | const QString & | name | ) | [explicit] |
Creates a new Option with the specified name.
name | The name of this Option. |
Definition at line 27 of file Option.cpp.
References ktutorial::OptionPrivate::mName, and name().
QString ktutorial::Option::name | ( | ) | const |
Returns the name of this Option.
Definition at line 36 of file Option.cpp.
References ktutorial::OptionPrivate::mName.
Referenced by Option().
void ktutorial::Option::selected | ( | ) | [signal] |