当前位置: 首页>>代码示例>>C++>>正文


C++ QScriptValue::data方法代码示例

本文整理汇总了C++中QScriptValue::data方法的典型用法代码示例。如果您正苦于以下问题:C++ QScriptValue::data方法的具体用法?C++ QScriptValue::data怎么用?C++ QScriptValue::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QScriptValue的用法示例。


在下文中一共展示了QScriptValue::data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setProperty

void QDiagramPluginLoaderClass::setProperty( QScriptValue & object, const QScriptString &name, uint id, const QScriptValue & value )
{
	QDiagramPluginLoader *c= qscriptvalue_cast<QDiagramPluginLoader*>(object.data());
	if (!c){
		return;
	}
}
开发者ID:BackupTheBerlios,项目名称:qdiagramtoolkit,代码行数:7,代码来源:qdiagrampluginloaderobject.cpp

示例2: QScriptClassPropertyIterator

ReflectivePropertyIterator::ReflectivePropertyIterator(
    const QScriptValue& object) : 
    QScriptClassPropertyIterator(object),
    m_idx(-1)
{
    m_node = qscriptvalue_cast< Node_ptr >(object.data());
}
开发者ID:asenac,项目名称:gsim,代码行数:7,代码来源:ReflectiveScriptClass.cpp

示例3: toScriptValue

QScriptValue SearchResultsScriptClass::toScriptValue(QScriptEngine *eng, const SearchResults &searchResults)
{
	QScriptValue ctor = eng->globalObject().property("SearchResults");
	SearchResultsScriptClass *cls = qscriptvalue_cast<SearchResultsScriptClass*>(ctor.data());
	if (!cls) return eng->newVariant(qVariantFromValue(searchResults));
	return cls->newInstance(searchResults);
}
开发者ID:Foxofoxes,项目名称:xVideoServiceThief,代码行数:7,代码来源:searchvideosscriptclass.cpp

示例4: toByteArray

QByteArray FilePrototype::toByteArray(const QScriptValue &value)
{
    ByteArrayClass *cls = getByteArrayClass(engine());
    return (cls && value.scriptClass() == cls)
            ? *qscriptvalue_cast<QByteArray*>(value.data())
            : value.toString().toUtf8();
}
开发者ID:Ack0,项目名称:CopyQ,代码行数:7,代码来源:fileprototype.cpp

示例5: toScriptValue

QScriptValue ByteArrayClass::toScriptValue(QScriptEngine *eng, const QByteArray &ba) {
    QScriptValue ctor = eng->globalObject().property("ByteArray");
    ByteArrayClass *cls = qscriptvalue_cast<ByteArrayClass*>(ctor.data());
    if (!cls)
        return eng->newVariant(QVariant::fromValue(ba));
    return cls->newInstance(ba);
}
开发者ID:AlbanBedel,项目名称:mixxx,代码行数:7,代码来源:bytearrayclass.cpp

示例6: propertyFlags

QScriptValue::PropertyFlags DefaultScriptClass::propertyFlags(const QScriptValue& object, const QScriptString& name, uint id)
{
    QScriptValue::PropertyFlags result;
    const ScriptHandlerInfo::Mode mode = mHandlerInfo->mode();
    Q_ASSERT(mode != ScriptHandlerInfo::None);
    DataInformation* data = toDataInformation(object);
    if (!data)
    {
        mHandlerInfo->logger()->error() << "could not cast data from" << object.data().toString();
        engine()->currentContext()->throwError(QScriptContext::ReferenceError,
                QStringLiteral("Attempting to access an invalid object"));
        return 0;
    }
    if (name == s_valid || name == s_validationError)
    {
        if (mode != ScriptHandlerInfo::Validating)
            result |= QScriptValue::ReadOnly;
    }
    else if (mode != ScriptHandlerInfo::Updating)
    {
        result |= QScriptValue::ReadOnly;
    }

    for (int i = 0, size = mIterableProperties.size(); i < size; ++i) {
        if (mIterableProperties.at(i).first == name)
            return result | mIterableProperties.at(i).second;
    }
    if (additionalPropertyFlags(data, name, id, &result))
        return result; //is a child element
    else
    {
        data->logError() << "could not find flags for property with name" << name.toString();
        return 0;
    }
}
开发者ID:KDE,项目名称:okteta,代码行数:35,代码来源:defaultscriptclass.cpp

示例7: property

QScriptValue ArrayBufferClass::property(const QScriptValue& object,
                                   const QScriptString& name, uint id) {
    QByteArray* ba = qscriptvalue_cast<QByteArray*>(object.data());
    if (ba && name == _byteLength) {
        return ba->length();
    }
    return QScriptValue();
}
开发者ID:AndrewMeadows,项目名称:hifi,代码行数:8,代码来源:ArrayBufferClass.cpp

示例8: toScriptValue

QScriptValue post_data_list_class::toScriptValue(QScriptEngine *eng, const http_data_list &pdl)
{
	QScriptValue ctor = eng->globalObject().property("post_data_list");
	post_data_list_class *cls = qscriptvalue_cast<post_data_list_class*>(ctor.data());
	if (!cls)
		return eng->newVariant(QVariant::fromValue(pdl));
	return cls->newInstance(pdl);
}
开发者ID:jadderbao,项目名称:http-post-test,代码行数:8,代码来源:http_script_engine.cpp

示例9: setProperty

 void setProperty(QScriptValue &object,
                   const QScriptString &name, uint, const QScriptValue & value)
 {
     if (name == str_forwardOnly) {
         QSqlQuery query = qscriptvalue_cast<QSqlQuery>(object.data());
         query.setForwardOnly(value.toBool());
     }
 }
开发者ID:NikhilNJ,项目名称:screenplay-dx,代码行数:8,代码来源:qdeclarativesqldatabase.cpp

示例10: property

QScriptValue QDiagramPluginLoaderClass::property(const QScriptValue &object, const QScriptString & name, uint id)
{
	QDiagramPluginLoader* c = qscriptvalue_cast<QDiagramPluginLoader*>(object.data());
	if (!c){
		return QScriptValue();
	}
	return QScriptValue();
}
开发者ID:BackupTheBerlios,项目名称:qdiagramtoolkit,代码行数:8,代码来源:qdiagrampluginloaderobject.cpp

示例11: toScriptValue

QScriptValue QDiagramPluginLoaderClass::toScriptValue(QScriptEngine* engine, const QDiagramPluginLoader & o)
{
	QScriptValue ctor = engine->globalObject().property("QDiagramPluginLoader");
	QDiagramPluginLoaderClass* c = qscriptvalue_cast<QDiagramPluginLoaderClass*>(ctor.data());
	if (!c){
		return engine->newVariant(qVariantFromValue(c));
	}
	return c->newInstance(o);
}
开发者ID:BackupTheBerlios,项目名称:qdiagramtoolkit,代码行数:9,代码来源:qdiagrampluginloaderobject.cpp

示例12: property

QScriptValue TypedArray::property(const QScriptValue& object,
                                      const QScriptString& name, uint id) {
    if (name == _bytesPerElementName) {
        return QScriptValue(_bytesPerElement);
    }
    if (name == _lengthName) {
        return object.data().property(_lengthName);
    }
    return ArrayBufferViewClass::property(object, name, id);
}
开发者ID:CoderPaulK,项目名称:hifi,代码行数:10,代码来源:TypedArrays.cpp

示例13: queryProperty

QScriptClass::QueryFlags ArrayBufferClass::queryProperty(const QScriptValue& object,
                                                    const QScriptString& name,
                                                    QueryFlags flags, uint* id) {
    QByteArray* ba = qscriptvalue_cast<QByteArray*>(object.data());
    if (ba && name == _byteLength) {
        // if the property queried is byteLength, only handle read access
        return flags &= HandlesReadAccess;
    }
    return 0; // No access
}
开发者ID:AndrewMeadows,项目名称:hifi,代码行数:10,代码来源:ArrayBufferClass.cpp

示例14: queryProperty

QScriptClass::QueryFlags TypedArray::queryProperty(const QScriptValue& object,
                                                   const QScriptString& name,
                                                   QueryFlags flags, uint* id) {
    if (name == _bytesPerElementName || name == _lengthName) {
        return flags &= HandlesReadAccess; // Only keep read access flags
    }
    
    quint32 byteOffset = object.data().property(_byteOffsetName).toInt32();
    quint32 length = object.data().property(_lengthName).toInt32();
    bool ok = false;
    quint32 pos = name.toArrayIndex(&ok);
    
    // Check that name is a valid index and arrayBuffer exists
    if (ok && pos < length) {
        *id = byteOffset + pos * _bytesPerElement; // save pos to avoid recomputation
        return HandlesReadAccess | HandlesWriteAccess; // Read/Write access
    }
    
    return ArrayBufferViewClass::queryProperty(object, name, flags, id);
}
开发者ID:CoderPaulK,项目名称:hifi,代码行数:20,代码来源:TypedArrays.cpp

示例15: toScriptValue

QScriptValue ArrayBufferClass::toScriptValue(QScriptEngine* engine, const QByteArray& ba) {
    QScriptValue ctor = engine->globalObject().property(CLASS_NAME);
    ArrayBufferClass* cls = qscriptvalue_cast<ArrayBufferClass*>(ctor.data());
    if (!cls) {
        if (engine->currentContext()) {
            engine->currentContext()->throwError("arrayBufferClass::toScriptValue -- could not get " + CLASS_NAME + " class constructor");
        }
        return QScriptValue::NullValue;
    }
    return cls->newInstance(ba);
}
开发者ID:AndrewMeadows,项目名称:hifi,代码行数:11,代码来源:ArrayBufferClass.cpp


注:本文中的QScriptValue::data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。