kjsembed
variant_binding.cpp
Go to the documentation of this file.
89 KJSEmbed::VariantBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::VariantBinding>(exec, self);
95 KJSEmbed::VariantBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::VariantBinding>(exec, self );
110 KJSEmbed::VariantBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::VariantBinding>(exec, self );
153 QMap<QString, QVariant> KJSEmbed::convertArrayToMap( KJS::ExecState *exec, KJS::JSValue *value )
236 int seconds = int( obj->get( exec, KJS::Identifier( "getSeconds" ) )->toObject( exec )->call( exec, obj, args )->toInteger( exec ) );
237 int minutes = int( obj->get( exec, KJS::Identifier( "getMinutes" ) )->toObject( exec )->call( exec, obj, args )->toInteger( exec ) );
238 int hours = int( obj->get( exec, KJS::Identifier( "getHours" ) )->toObject( exec )->call( exec, obj, args )->toInteger( exec ) );
239 int month = int( obj->get( exec, KJS::Identifier( "getMonth" ) )->toObject( exec )->call( exec, obj, args )->toInteger( exec ) );
240 int day = int( obj->get( exec, KJS::Identifier( "getDate" ) )->toObject( exec )->call( exec, obj, args )->toInteger( exec ) );
241 int year = int( obj->get( exec, KJS::Identifier( "getFullYear" ) )->toObject( exec )->call( exec, obj, args )->toInteger( exec ) );
301 qDebug()<<"KJSEmbed::convertToValue typeid="<<value.type()<<"typename="<<value.typeName()<<"toString="<<value.toString();
380 KJS::JSObject *obj = exec->lexicalInterpreter()->builtinObject()->construct( exec, KJS::List() );
390 returnValue = widget ? createQObject(exec, widget, KJSEmbed::ObjectBinding::CPPOwned) : KJS::jsNull();
394 returnValue = object ? createQObject(exec, object, KJSEmbed::ObjectBinding::CPPOwned) : KJS::jsNull();
413 KJSEmbed::VariantBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::VariantBinding>(exec, value );
QVariant KJSEMBED_EXPORT convertToVariant(KJS::ExecState *exec, KJS::JSValue *value)
Convert a KJS::JSValue into a QVariant object.
Definition: variant_binding.cpp:253
VariantBinding(KJS::ExecState *exec, const QVariant &value)
Create a new binding implementation with a QVariant to wrap.
Definition: variant_binding.cpp:47
Definition: qobject_binding.h:79
int minute() const
KJS::UString className() const
Definition: variant_binding.cpp:63
Definition: variant_binding.cpp:130
QStringList KJSEMBED_EXPORT convertArrayToStringList(KJS::ExecState *exec, KJS::JSValue *value)
Convert a KJS::JSValue inot a QStringList.
Definition: variant_binding.cpp:199
static void publish(KJS::ExecState *exec, KJS::JSObject *object, const Method *methods)
Publishes an array of Methods to an object.
Definition: static_binding.cpp:60
QMap< QString, QVariant > KJSEMBED_EXPORT convertArrayToMap(KJS::ExecState *exec, KJS::JSValue *value)
Convert a KJS::JSValue that contains an associative array into a QMap.
Definition: variant_binding.cpp:153
Definition: binding_support.h:247
QByteArray & setNum(short n, int base)
QList< QVariant > toList() const
QDateTime toDateTime() const
KJS::JSValue * createVariant(KJS::ExecState *exec, const KJS::UString &className, const T &value)
Can create any known KJSEmbed::VariantBinding object and set the value.
Definition: variant_binding.h:185
KJS::UString toString(KJS::ExecState *) const
Definition: variant_binding.cpp:58
QTime toTime() const
void setTime(const QTime &time)
static const Method VariantMethods[]
Definition: variant_binding.h:250
T value() const
QTime time() const
JavaScriptArrayType checkArray(KJS::ExecState *exec, KJS::JSValue *val)
Definition: variant_binding.cpp:132
int month() const
int second() const
KJS::JSValue * callCast(KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args)
Definition: variant_binding.cpp:93
KJSEMBED_EXPORT KJS::JSObject * createQObject(KJS::ExecState *exec, QObject *value, KJSEmbed::ObjectBinding::Ownership owner=KJSEmbed::ObjectBinding::JSOwned)
Returns a binding object for the specified QObject.
Definition: qobject_binding.cpp:735
void append(const T &value)
QDateTime convertDateToDateTime(KJS::ExecState *exec, KJS::JSValue *value)
Definition: variant_binding.cpp:229
Type nameToType(const char *name)
QList< QVariant > KJSEMBED_EXPORT convertArrayToList(KJS::ExecState *exec, KJS::JSValue *value)
Convert a KJS::JSValue into a QList.
Definition: variant_binding.cpp:169
bool isEmpty() const
int day() const
void setDate(const QDate &date)
typedef Iterator
int year() const
iterator end()
void setValue(const QVariant &val)
Set the internal value of the QVariant.
Definition: variant_binding.cpp:73
iterator begin()
int hour() const
iterator end()
int msec() const
void setValue(const T &value)
const Key key(const T &value) const
QDate toDate() const
QDateTime currentDateTime()
QMap< QString, QVariant > toMap() const
QDate date() const
Definition: variant_binding.cpp:130
const char * typeName() const
char * data()
KJS::JSValue * callName(KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args)
Definition: variant_binding.cpp:86
KJSEMBED_EXPORT KJS::JSValue * convertToValue(KJS::ExecState *exec, const QVariant &value)
Convert a QVariant to a KJS::JSValue.
Definition: variant_binding.cpp:298
Definition: variant_binding.cpp:130
QGenericArgument arg(const char *type) const
Constructs a QGenericArgument that is used with QMetaObject::invokeMember.
Definition: variant_binding.cpp:78
Type type() const
KJS::JSValue * callToString(KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args)
Definition: variant_binding.cpp:107
bool convert(Type t)
QString toString() const
QVariant KJSEMBED_EXPORT extractVariant(KJS::ExecState *exec, KJS::JSValue *value)
Extracts a QVariant from a KJS::JSValue if the conversion fails a QVariant::Null is returned...
Definition: variant_binding.cpp:407
iterator begin()
const T value(const Key &key) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.