kexi
KoMacro::Variable Class Reference
#include <variable.h>
Inheritance diagram for KoMacro::Variable:

Detailed Description
A variable value used to provide abstract access to variables.The class handles QVariant and QObject and provides access to them. Variable inherits KShared and implements reference couting. So, it's not needed to take care of memory-managment.
Definition at line 38 of file variable.h.
Public Types | |
typedef QValueList< KSharedPtr< Variable > > | List |
typedef QMap< QString, KSharedPtr< Variable > > | Map |
Public Member Functions | |
Variable () | |
Variable (const QVariant &variant, const QString &name=QString::null, const QString &text=QString::null) | |
Variable (const QObject *object) | |
Variable (const QDomElement &element) | |
virtual | ~Variable () |
QString | name () const |
void | setName (const QString &name) |
QString | text () const |
void | setText (const QString &text) |
void | setObject (const QObject *object) |
const QVariant | variant () const |
void | setVariant (const QVariant &variant, bool detecttype=true) |
const QObject * | object () const |
operator QVariant () const | |
operator const QObject * () const | |
const QString | toString () const |
int | toInt () const |
List | children () const |
void | appendChild (KSharedPtr< Variable > variable) |
void | clearChildren () |
void | setChildren (const List &children) |
Properties | |
QVariant | variant [] |
QObject | object [] |
QString | string [] |
Member Typedef Documentation
typedef QValueList<KSharedPtr<Variable > > KoMacro::Variable::List |
A list of variables.
Reimplemented from KoMacro::MetaParameter.
Definition at line 61 of file variable.h.
typedef QMap<QString, KSharedPtr<Variable > > KoMacro::Variable::Map |
Constructor & Destructor Documentation
Variable::Variable | ( | ) | [explicit] |
Variable::Variable | ( | const QVariant & | variant, | |
const QString & | name = QString::null , |
|||
const QString & | text = QString::null | |||
) |
Constructor from the QVariant variant
.
- Parameters:
-
variant The value this variable has. name The unique name() this variable has. text The describing text() this variable has.
Definition at line 87 of file variable.cpp.
Variable::Variable | ( | const QObject * | object | ) |
Constructor from the QObject object
.
- Parameters:
-
object The value this variable has.
Definition at line 98 of file variable.cpp.
Variable::Variable | ( | const QDomElement & | element | ) |
Constructor from the QDomElement element
.
- Deprecated:
- replaced with methods of XMLHandler.
- Parameters:
-
element The QDomElement that may optional contains the variable content or other additional informations.
Definition at line 106 of file variable.cpp.
Variable::~Variable | ( | ) | [virtual] |
Member Function Documentation
QString Variable::name | ( | ) | const |
void Variable::setName | ( | const QString & | name | ) |
QString Variable::text | ( | ) | const |
void Variable::setText | ( | const QString & | text | ) |
void Variable::setObject | ( | const QObject * | object | ) |
Set the QObject.
- Parameters:
-
object this variable has. A previously remembered value will be overwritten and the new type is a TypeObject .
Definition at line 179 of file variable.cpp.
const QVariant KoMacro::Variable::variant | ( | ) | const |
- Returns:
- the QVariant this variable has.
If this variable isn't a TypeVariant an invalid QVariant got returned.
void Variable::setVariant | ( | const QVariant & | variant, | |
bool | detecttype = true | |||
) |
Set the QVariant.
- Parameters:
-
variant this variable has. A previously remembered value will be overwritten and the new type is a TypeVariant . If detecttype is true the method tries to set the variantType according to the passed QVariant. If false the variantType won't be changed.
Definition at line 165 of file variable.cpp.
const QObject* KoMacro::Variable::object | ( | ) | const |
- Returns:
- the QObject this variable has.
If this variable isn't a TypeObject NULL got returned.
Variable::operator QVariant | ( | ) | const |
Implicit conversion to QVariant operator.
This method calls variant() internaly.
Definition at line 185 of file variable.cpp.
Variable::operator const QObject * | ( | ) | const |
Implicit conversion to QObject operator.
This method calls object() internaly.
Definition at line 190 of file variable.cpp.
const QString Variable::toString | ( | ) | const |
int Variable::toInt | ( | ) | const |
Variable::List Variable::children | ( | ) | const |
- Note:
- that the list is returned call-by-reference. The list is accessed as getter/setter (read/write). So, don't set this method to const!
Definition at line 216 of file variable.cpp.
void Variable::appendChild | ( | KSharedPtr< Variable > | variable | ) |
Append a Variable to the list of children this Variable has.
Definition at line 221 of file variable.cpp.
void Variable::clearChildren | ( | ) |
Property Documentation
const QVariant Variable::variant [read, write] |
const QObject * Variable::object [read, write] |
QString KoMacro::Variable::string [read] |
The documentation for this class was generated from the following files: