KTutorial  0.5.1
Signals | Public Member Functions
ktutorial::Option Class Reference

An option shown to the user. More...

#include <Option.h>

List of all members.

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.

Detailed Description

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.

Definition at line 52 of file Option.h.


Constructor & Destructor Documentation

ktutorial::Option::Option ( const QString &  name) [explicit]

Creates a new Option with the specified name.

Parameters:
nameThe name of this Option.

Definition at line 27 of file Option.cpp.

References ktutorial::OptionPrivate::mName, and name().


Member Function Documentation

QString ktutorial::Option::name ( ) const

Returns the name of this Option.

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]

This signal is emitted when this Option is selected by the user.

If a KTutorial customization is used, you must emit this signal (connecting it to another signal) when the user selects the option in the UI.


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