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


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

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


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

示例1: qtscript_create_QDomText_class

QScriptValue qtscript_create_QDomText_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<QDomText*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QDomText*)0));
    proto.setPrototype(engine->defaultPrototype(qMetaTypeId<QDomCharacterData*>()));
    for (int i = 0; i < 2; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QDomText_prototype_call, qtscript_QDomText_function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_QDomText_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    engine->setDefaultPrototype(qMetaTypeId<QDomText>(), proto);
    engine->setDefaultPrototype(qMetaTypeId<QDomText*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QDomText_static_call, proto, qtscript_QDomText_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    return ctor;
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:20,代码来源:qtscript_QDomText.cpp

示例2: qtscript_create_QTableWidgetItem_class

QScriptValue qtscript_create_QTableWidgetItem_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<QTableWidgetItem*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QTableWidgetItem*)0));
    for (int i = 0; i < 34; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QTableWidgetItem_prototype_call, qtscript_QTableWidgetItem_function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_QTableWidgetItem_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    engine->setDefaultPrototype(qMetaTypeId<QTableWidgetItem*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QTableWidgetItem_static_call, proto, qtscript_QTableWidgetItem_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    ctor.setProperty(QString::fromLatin1("ItemType"),
        qtscript_create_QTableWidgetItem_ItemType_class(engine, ctor));
    return ctor;
}
开发者ID:DanielJSlick,项目名称:qcad,代码行数:20,代码来源:qtscript_QTableWidgetItem.cpp

示例3: qtscript_create_QToolBar_class

QScriptValue qtscript_create_QToolBar_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<QToolBar*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QToolBar*)0));
    proto.setPrototype(engine->defaultPrototype(qMetaTypeId<QWidget*>()));
    for (int i = 0; i < 22; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QToolBar_prototype_call, qtscript_QToolBar_function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_QToolBar_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    qScriptRegisterMetaType<QToolBar*>(engine, qtscript_QToolBar_toScriptValue, 
        qtscript_QToolBar_fromScriptValue, proto);

    QScriptValue ctor = engine->newFunction(qtscript_QToolBar_static_call, proto, qtscript_QToolBar_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    return ctor;
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:20,代码来源:qtscript_QToolBar.cpp

示例4: qtscript_create_QDomImplementation_class

QScriptValue qtscript_create_QDomImplementation_class(QScriptEngine *engine)
{
    static const int function_lengths[] = {
        1
        // static
        , 0
        , 1
        // prototype
        , 3
        , 3
        , 2
        , 0
        , 1
        , 0
    };
    engine->setDefaultPrototype(qMetaTypeId<QDomImplementation*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QDomImplementation*)0));
    for (int i = 0; i < 6; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QDomImplementation_prototype_call, function_lengths[i+3]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_QDomImplementation_function_names[i+3]),
            fun, QScriptValue::SkipInEnumeration);
    }

    engine->setDefaultPrototype(qMetaTypeId<QDomImplementation>(), proto);
    engine->setDefaultPrototype(qMetaTypeId<QDomImplementation*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QDomImplementation_static_call, proto, function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));
    for (int i = 0; i < 2; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QDomImplementation_static_call,
            function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i+1)));
        ctor.setProperty(QString::fromLatin1(qtscript_QDomImplementation_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    ctor.setProperty(QString::fromLatin1("InvalidDataPolicy"),
        qtscript_create_QDomImplementation_InvalidDataPolicy_class(engine, ctor));
    return ctor;
}
开发者ID:SSMN,项目名称:MuseScore,代码行数:41,代码来源:qtscript_QDomImplementation.cpp

示例5: qtscript_create_QLayoutItem_class

QScriptValue qtscript_create_QLayoutItem_class(QScriptEngine *engine)
{
    static const int function_lengths[] = {
        1
        // static
        // prototype
        , 0
        , 0
        , 0
        , 0
        , 0
        , 1
        , 0
        , 0
        , 0
        , 0
        , 1
        , 0
        , 1
        , 1
        , 0
        , 0
        , 0
        , 0
    };
    engine->setDefaultPrototype(qMetaTypeId<QLayoutItem*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QLayoutItem*)0));
    for (int i = 0; i < 18; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QLayoutItem_prototype_call, function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_QLayoutItem_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    engine->setDefaultPrototype(qMetaTypeId<QLayoutItem*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QLayoutItem_static_call, proto, function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    return ctor;
}
开发者ID:Mistobaan,项目名称:MuseScore,代码行数:41,代码来源:qtscript_QLayoutItem.cpp

示例6: qtscript_create_QNetworkReply_class

QScriptValue qtscript_create_QNetworkReply_class(QScriptEngine *engine)
{
    static const int function_lengths[] = {
        0
        // static
        // prototype
        , 0
        , 1
        , 0
        , 1
        , 1
        , 0
        , 0
        , 1
        , 0
        , 0
        , 0
        , 1
        , 0
        , 0
    };
    engine->setDefaultPrototype(qMetaTypeId<QNetworkReply*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QNetworkReply*)0));
    proto.setPrototype(engine->defaultPrototype(qMetaTypeId<QIODevice*>()));
    for (int i = 0; i < 14; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QNetworkReply_prototype_call, function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_QNetworkReply_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    qScriptRegisterMetaType<QNetworkReply*>(engine, qtscript_QNetworkReply_toScriptValue, 
        qtscript_QNetworkReply_fromScriptValue, proto);

    QScriptValue ctor = engine->newFunction(qtscript_QNetworkReply_static_call, proto, function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    ctor.setProperty(QString::fromLatin1("NetworkError"),
        qtscript_create_QNetworkReply_NetworkError_class(engine, ctor));
    return ctor;
}
开发者ID:SSMN,项目名称:MuseScore,代码行数:41,代码来源:qtscript_QNetworkReply.cpp

示例7: qtscript_create_QFutureSynchronizer_class

QScriptValue qtscript_create_QFutureSynchronizer_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<QtScriptFutureSynchronizer*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QtScriptFutureSynchronizer*)0));

    engine->setDefaultPrototype(qMetaTypeId<QtScriptFutureSynchronizer*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QFutureSynchronizer_static_call, proto, qtscript_QFutureSynchronizer_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    return ctor;
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:12,代码来源:qtscript_QFutureSynchronizer.cpp

示例8: qtscript_create_MediaSource_class

QScriptValue qtscript_create_MediaSource_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<Phonon::MediaSource*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((Phonon::MediaSource*)0));
    for (int i = 0; i < 10; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_MediaSource_prototype_call, qtscript_MediaSource_function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_MediaSource_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    engine->setDefaultPrototype(qMetaTypeId<Phonon::MediaSource>(), proto);
    engine->setDefaultPrototype(qMetaTypeId<Phonon::MediaSource*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_MediaSource_static_call, proto, qtscript_MediaSource_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    ctor.setProperty(QString::fromLatin1("Type"),
        qtscript_create_MediaSource_Type_class(engine, ctor));
    return ctor;
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:21,代码来源:qtscript_MediaSource.cpp

示例9: qtscript_create_QTextBlockUserData_class

QScriptValue qtscript_create_QTextBlockUserData_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<QTextBlockUserData*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QTextBlockUserData*)0));

    engine->setDefaultPrototype(qMetaTypeId<QTextBlockUserData*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QTextBlockUserData_static_call, proto, qtscript_QTextBlockUserData_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    return ctor;
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:12,代码来源:qtscript_QTextBlockUserData.cpp

示例10: qtscript_create_QWebElement_class

QScriptValue qtscript_create_QWebElement_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<QWebElement*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QWebElement*)0));
    for (int i = 0; i < 55; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QWebElement_prototype_call, qtscript_QWebElement_function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_QWebElement_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    engine->setDefaultPrototype(qMetaTypeId<QWebElement>(), proto);
    engine->setDefaultPrototype(qMetaTypeId<QWebElement*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QWebElement_static_call, proto, qtscript_QWebElement_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    ctor.setProperty(QString::fromLatin1("StyleResolveStrategy"),
        qtscript_create_QWebElement_StyleResolveStrategy_class(engine, ctor));
    return ctor;
}
开发者ID:DanielJSlick,项目名称:qcad,代码行数:21,代码来源:qtscript_QWebElement.cpp

示例11: qtscript_create_QDesktopServices_class

QScriptValue qtscript_create_QDesktopServices_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<QDesktopServices*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QDesktopServices*)0));

    engine->setDefaultPrototype(qMetaTypeId<QDesktopServices*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QDesktopServices_static_call, proto, qtscript_QDesktopServices_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));
    for (int i = 0; i < 5; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QDesktopServices_static_call,
            qtscript_QDesktopServices_function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i+1)));
        ctor.setProperty(QString::fromLatin1(qtscript_QDesktopServices_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    ctor.setProperty(QString::fromLatin1("StandardLocation"),
        qtscript_create_QDesktopServices_StandardLocation_class(engine, ctor));
    return ctor;
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:21,代码来源:qtscript_QDesktopServices.cpp

示例12: qtscript_create_QWebPluginFactory_ExtensionOption_class

QScriptValue qtscript_create_QWebPluginFactory_ExtensionOption_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<QWebPluginFactory::ExtensionOption*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QWebPluginFactory::ExtensionOption*)0));

    engine->setDefaultPrototype(qMetaTypeId<QWebPluginFactory::ExtensionOption*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QWebPluginFactory_ExtensionOption_static_call, proto, qtscript_QWebPluginFactory_ExtensionOption_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    return ctor;
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:12,代码来源:qtscript_QWebPluginFactory_ExtensionOption.cpp

示例13: qtscript_create_QFont_class

QScriptValue qtscript_create_QFont_class(QScriptEngine *engine)
{
    engine->setDefaultPrototype(qMetaTypeId<QFont*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QFont*)0));
    for (int i = 0; i < 59; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QFont_prototype_call, qtscript_QFont_function_lengths[i+10]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_QFont_function_names[i+10]),
            fun, QScriptValue::SkipInEnumeration);
    }

    engine->setDefaultPrototype(qMetaTypeId<QFont>(), proto);
    engine->setDefaultPrototype(qMetaTypeId<QFont*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QFont_static_call, proto, qtscript_QFont_function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));
    for (int i = 0; i < 9; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QFont_static_call,
            qtscript_QFont_function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i+1)));
        ctor.setProperty(QString::fromLatin1(qtscript_QFont_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    ctor.setProperty(QString::fromLatin1("StyleStrategy"),
        qtscript_create_QFont_StyleStrategy_class(engine, ctor));
    ctor.setProperty(QString::fromLatin1("SpacingType"),
        qtscript_create_QFont_SpacingType_class(engine, ctor));
    ctor.setProperty(QString::fromLatin1("StyleHint"),
        qtscript_create_QFont_StyleHint_class(engine, ctor));
    ctor.setProperty(QString::fromLatin1("Weight"),
        qtscript_create_QFont_Weight_class(engine, ctor));
    ctor.setProperty(QString::fromLatin1("Capitalization"),
        qtscript_create_QFont_Capitalization_class(engine, ctor));
    ctor.setProperty(QString::fromLatin1("Stretch"),
        qtscript_create_QFont_Stretch_class(engine, ctor));
    ctor.setProperty(QString::fromLatin1("Style"),
        qtscript_create_QFont_Style_class(engine, ctor));
    return ctor;
}
开发者ID:Jinxiaohai,项目名称:QT,代码行数:40,代码来源:qtscript_QFont.cpp

示例14: qtscript_create_QGradient_class

QScriptValue qtscript_create_QGradient_class(QScriptEngine *engine)
{
    static const int function_lengths[] = {
        0
        // static
        // prototype
        , 0
        , 1
        , 2
        , 1
        , 1
        , 1
        , 0
        , 0
        , 0
        , 0
    };
    engine->setDefaultPrototype(qMetaTypeId<QGradient*>(), QScriptValue());
    QScriptValue proto = engine->newVariant(qVariantFromValue((QGradient*)0));
    for (int i = 0; i < 10; ++i) {
        QScriptValue fun = engine->newFunction(qtscript_QGradient_prototype_call, function_lengths[i+1]);
        fun.setData(QScriptValue(engine, uint(0xBABE0000 + i)));
        proto.setProperty(QString::fromLatin1(qtscript_QGradient_function_names[i+1]),
            fun, QScriptValue::SkipInEnumeration);
    }

    engine->setDefaultPrototype(qMetaTypeId<QGradient>(), proto);
    engine->setDefaultPrototype(qMetaTypeId<QGradient*>(), proto);

    QScriptValue ctor = engine->newFunction(qtscript_QGradient_static_call, proto, function_lengths[0]);
    ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0)));

    ctor.setProperty(QString::fromLatin1("CoordinateMode"),
        qtscript_create_QGradient_CoordinateMode_class(engine, ctor));
    ctor.setProperty(QString::fromLatin1("Spread"),
        qtscript_create_QGradient_Spread_class(engine, ctor));
    ctor.setProperty(QString::fromLatin1("Type"),
        qtscript_create_QGradient_Type_class(engine, ctor));
    return ctor;
}
开发者ID:Mistobaan,项目名称:MuseScore,代码行数:40,代码来源:qtscript_QGradient.cpp

示例15: registerGlobalShortcutFunction

void KWin::Script::installScriptFunctions(QScriptEngine* engine)
{
    // add our print
    QScriptValue printFunc = engine->newFunction(kwinScriptPrint);
    printFunc.setData(engine->newQObject(this));
    engine->globalObject().setProperty(QStringLiteral("print"), printFunc);
    // add read config
    QScriptValue configFunc = engine->newFunction(kwinScriptReadConfig);
    configFunc.setData(engine->newQObject(this));
    engine->globalObject().setProperty(QStringLiteral("readConfig"), configFunc);
    QScriptValue dbusCallFunc = engine->newFunction(kwinCallDBus);
    dbusCallFunc.setData(engine->newQObject(this));
    engine->globalObject().setProperty(QStringLiteral("callDBus"), dbusCallFunc);
    // add global Shortcut
    registerGlobalShortcutFunction(this, engine, kwinScriptGlobalShortcut);
    // add screen edge
    registerScreenEdgeFunction(this, engine, kwinRegisterScreenEdge);
    // add user actions menu register function
    regesterUserActionsMenuFunction(this, engine, kwinRegisterUserActionsMenu);
    // add assertions
    QScriptValue assertTrueFunc = engine->newFunction(kwinAssertTrue);
    engine->globalObject().setProperty(QStringLiteral("assertTrue"), assertTrueFunc);
    engine->globalObject().setProperty(QStringLiteral("assert"), assertTrueFunc);
    QScriptValue assertFalseFunc = engine->newFunction(kwinAssertFalse);
    engine->globalObject().setProperty(QStringLiteral("assertFalse"), assertFalseFunc);
    QScriptValue assertEqualsFunc = engine->newFunction(kwinAssertEquals);
    engine->globalObject().setProperty(QStringLiteral("assertEquals"), assertEqualsFunc);
    QScriptValue assertNullFunc = engine->newFunction(kwinAssertNull);
    engine->globalObject().setProperty(QStringLiteral("assertNull"), assertNullFunc);
    engine->globalObject().setProperty(QStringLiteral("assertEquals"), assertEqualsFunc);
    QScriptValue assertNotNullFunc = engine->newFunction(kwinAssertNotNull);
    engine->globalObject().setProperty(QStringLiteral("assertNotNull"), assertNotNullFunc);
    // global properties
    engine->globalObject().setProperty(QStringLiteral("KWin"), engine->newQMetaObject(&WorkspaceWrapper::staticMetaObject));
    QScriptValue workspace = engine->newQObject(Scripting::self()->workspaceWrapper(), QScriptEngine::QtOwnership,
                                                QScriptEngine::ExcludeSuperClassContents | QScriptEngine::ExcludeDeleteLater);
    engine->globalObject().setProperty(QStringLiteral("workspace"), workspace, QScriptValue::Undeletable);
    // install meta functions
    KWin::MetaScripting::registration(engine);
}
开发者ID:8l,项目名称:kwin,代码行数:40,代码来源:scripting.cpp


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