lib
Kross::Api::Variant Class Reference
#include <variant.h>

Detailed Description
Variant value to wrap a QVariant into a Kross::Api::Value to enable primitive types like strings or numerics.Definition at line 38 of file variant.h.
Public Member Functions | |
Variant (const QVariant &value) | |
operator bool () | |
operator int () | |
operator uint () | |
operator double () | |
operator const char * () | |
operator QString () | |
operator const QString () | |
operator const QString & () | |
operator QCString () | |
operator const QCString () | |
operator const QCString & () | |
operator QVariant () | |
operator const QVariant () | |
operator const QVariant & () | |
operator QStringList () | |
operator QValueList< QVariant > () | |
virtual | ~Variant () |
virtual const QString | getClassName () const |
virtual const QString | toString () |
Static Public Member Functions | |
static const QVariant & | toVariant (Object::Ptr object) |
static const QString | toString (Object::Ptr object) |
static int | toInt (Object::Ptr object) |
static uint | toUInt (Object::Ptr object) |
static double | toDouble (Object::Ptr object) |
static Q_LLONG | toLLONG (Object::Ptr object) |
static Q_ULLONG | toULLONG (Object::Ptr object) |
static bool | toBool (Object::Ptr object) |
static QStringList | toStringList (Object::Ptr object) |
static QValueList< QVariant > | toList (Object::Ptr object) |
Friends | |
class | Value< Variant, QVariant > |
Constructor & Destructor Documentation
Variant::Variant | ( | const QVariant & | value | ) |
Constructor.
- Parameters:
-
value The initial QVariant-value this Variant-Object has. name The name this Value has.
Definition at line 27 of file variant.cpp.
Variant::~Variant | ( | ) | [virtual] |
Member Function Documentation
Kross::Api::Variant::operator QStringList | ( | ) | [inline] |
Operator to return a QStringList.
We can not just use getValue().toStringList() here cause maybe this Kross::Api::Variant is a Kross::Api::List which could be internaly used for list of strings as well. So, we use the toStringList() function which will take care of translating a Kross::Api::List to a QStringList if possible or to throw an exception if the Kross::Api::List isn't a QStringList.
const QString Variant::getClassName | ( | ) | const [virtual] |
- See also:
- Kross::Api::Object::getClassName()
Implements Kross::Api::Object.
Definition at line 36 of file variant.cpp.
const QString Variant::toString | ( | ) | [virtual] |
- Returns:
- a string representation of the variant.
- See also:
- Kross::Api::Object::toString()
Reimplemented from Kross::Api::Object.
Definition at line 41 of file variant.cpp.
const QVariant & Variant::toVariant | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a QVariant.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a QVariant converted object.
Definition at line 75 of file variant.cpp.
const QString Variant::toString | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a QString.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a QString converted object.
Definition at line 80 of file variant.cpp.
int Variant::toInt | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a int.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a int converted object.
Definition at line 88 of file variant.cpp.
uint Variant::toUInt | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a uint.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a uint converted object.
Definition at line 96 of file variant.cpp.
double Variant::toDouble | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a uint.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a uint converted object.
Definition at line 104 of file variant.cpp.
Q_LLONG Variant::toLLONG | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a Q_LLONG.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a Q_LLONG converted object.
Definition at line 112 of file variant.cpp.
Q_ULLONG Variant::toULLONG | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a Q_ULLONG.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a Q_ULLONG converted object.
Definition at line 120 of file variant.cpp.
bool Variant::toBool | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a boolean value.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a bool converted object.
Definition at line 128 of file variant.cpp.
QStringList Variant::toStringList | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a QStringList.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a QValueList converted object.
Definition at line 136 of file variant.cpp.
QValueList< QVariant > Variant::toList | ( | Object::Ptr | object | ) | [static] |
Try to convert the given Object into a QValueList of QVariant's.
- Exceptions:
-
TypeException If the convert failed.
- Parameters:
-
object The object to convert.
- Returns:
- The to a QValueList converted object.
Definition at line 153 of file variant.cpp.
The documentation for this class was generated from the following files: