本文整理汇总了C++中QScriptValueImpl::engine方法的典型用法代码示例。如果您正苦于以下问题:C++ QScriptValueImpl::engine方法的具体用法?C++ QScriptValueImpl::engine怎么用?C++ QScriptValueImpl::engine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScriptValueImpl
的用法示例。
在下文中一共展示了QScriptValueImpl::engine方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mark
void FunctionClassData::mark(const QScriptValueImpl &object, int generation)
{
if (object.classInfo() != classInfo())
return;
QScriptFunction *fun = object.toFunction();
QScriptEnginePrivate *eng = QScriptEnginePrivate::get(object.engine());
fun->mark(eng, generation);
}
示例2: addFunction
void Math::addFunction(QScriptValueImpl &object, const QString &name,
QScriptInternalFunctionSignature fun, int length,
const QScriptValue::PropertyFlags flags)
{
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(object.engine());
QScriptValueImpl val = eng_p->createFunction(fun, length, object.classInfo(), name);
object.setProperty(name, val, flags);
}
示例3: mark
void EnumerationClassData::mark(const QScriptValueImpl &object, int generation)
{
Q_ASSERT(object.isValid());
QScriptEnginePrivate *eng = object.engine();
if (Enumeration::Instance *instance = Enumeration::Instance::get(object, classInfo())) {
eng->markObject(instance->object, generation);
if (instance->it)
eng->markObject(instance->it->object(), generation);
}
}
示例4: get
bool FunctionClassData::get(const QScriptValueImpl &object, const Member &member,
QScriptValueImpl *result)
{
if (object.classInfo() != classInfo())
return false;
QScriptEnginePrivate *eng = QScriptEnginePrivate::get(object.engine());
if (! member.isNativeProperty())
return false;
if (member.nameId() == eng->idTable()->id_length) {
eng->newNumber(result, object.toFunction()->length);
return true;
} else if (member.nameId() == eng->idTable()->id_arguments) {
eng->newNull(result);
return true;
}
return false;
}
示例5: resolve
bool FunctionClassData::resolve(const QScriptValueImpl &object,
QScriptNameIdImpl *nameId,
QScript::Member *member, QScriptValueImpl *base)
{
if (object.classInfo() != classInfo())
return false;
QScriptEnginePrivate *eng = QScriptEnginePrivate::get(object.engine());
if ((nameId == eng->idTable()->id_length)
|| (nameId == eng->idTable()->id_arguments)) {
member->native(nameId, /*id=*/ 0,
QScriptValue::Undeletable
| QScriptValue::ReadOnly
| QScriptValue::SkipInEnumeration);
*base = object;
return true;
}
return false;
}