Eneboo - Documentación para desarrolladores
|
The QSArgument class provides storage for various datatypes used in QSObjectFactory::create() calls. Más...
#include <qsargument.h>
Tipos públicos | |
enum | Type { Invalid, Variant, QObjectPtr, VoidPointer } |
Métodos públicos | |
QSArgument () | |
QSArgument (const QVariant &v) | |
QSArgument (QObject *o) | |
QSArgument (void *p) | |
QVariant | variant () const |
QObject * | qobject () const |
void * | ptr () const |
Type | type () const |
QString | typeName () const |
Amigas | |
bool | operator== (const QSArgument &a, const QSArgument &b) |
The QSArgument class provides storage for various datatypes used in QSObjectFactory::create() calls.
When the user writes Qt Script code like this:
var x = new AnotherCppObject( arg1, arg2 ); // Qt Script
the arguments are passed to the QSObjectFactory::create() call as a QValueList of QSArguments. A QSArgument can hold a QVariant, a QObject pointer or a void pointer. The type held by a QSArgument is returned by type() and the value is returned by variant(), qobject(), or ptr(), depending on the QSArgument type.
enum QSArgument::Type |
This enum describes which datatype is held by this QSArgument.
Invalid Invalid datatype Variant Holds a QVariant QObjectPtr Holds a QObject pointer VoidPointer Holds an untyped pointer (void*)
QSArgument::QSArgument | ( | ) |
Creates an invalid QSArgument
QSArgument::QSArgument | ( | const QVariant & | v | ) |
Creates a QSArgument which holds the variant v as its value and is of type Variant.
QSArgument::QSArgument | ( | QObject * | o | ) |
Creates a QSArgument which holds the QObject pointer o as its value and is of type QObjectPtr.
QSArgument::QSArgument | ( | void * | p | ) |
Creates a QSArgument which holds the pointer p as its value and is of type VoidPointer.
void * QSArgument::ptr | ( | ) | const |
If this QSArgument's type() is VoidPointer, it returns the void pointer; otherwise returns 0.
QObject * QSArgument::qobject | ( | ) | const |
If this QSArgument's type() is QObjectPtr, it returns the object pointer; otherwise returns 0.
QSArgument::Type QSArgument::type | ( | ) | const |
Returns the type of this QSArgument. This can be Invalid
, Variant
, QObjectPtr
, or VoidPointer
QString QSArgument::typeName | ( | ) | const |
Returns the type name of this argument.
QVariant QSArgument::variant | ( | ) | const |
If this QSArgument's type() is Variant, it returns the variant value; otherwise returns an invalid variant.
bool operator== | ( | const QSArgument & | a, |
const QSArgument & | b | ||
) | [friend] |