Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QVariant QScriptValue::toVariant (  )  const

Returns the QVariant value of this QScriptValue, if it can be converted to a QVariant; otherwise returns an invalid QVariant. The conversion is performed according to the following table:

Input Type Result Undefined An invalid QVariant. Null An invalid QVariant. Boolean A QVariant containing the value of the boolean. Number A QVariant containing the value of the number. String A QVariant containing the value of the string. QVariant Object The result is the QVariant value of the object (no conversion). QObject Object A QVariant containing a pointer to the QObject. Date Object A QVariant containing the date value (toDateTime()). RegExp Object A QVariant containing the regular expression value (toRegExp()). Object If the value is primitive, then the result is converted to a QVariant according to the above rules; otherwise, an invalid QVariant is returned.

See also:
isVariant()

Definition at line 662 of file qscriptvalue.cpp.

{
    return QScriptValuePrivate::valueOf(*this).toVariant();
}


Generated by  Doxygen 1.6.0   Back to index