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


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

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


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

示例1: qtscript_QStyleOptionRubberBand_StyleOptionType_toScriptValue

static QScriptValue qtscript_QStyleOptionRubberBand_StyleOptionType_toScriptValue(QScriptEngine *engine, const QStyleOptionRubberBand::StyleOptionType &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QStyleOptionRubberBand"));
    return clazz.property(qtscript_QStyleOptionRubberBand_StyleOptionType_toStringHelper(value));
}
开发者ID:DanielJSlick,项目名称:qcad,代码行数:5,代码来源:qtscript_QStyleOptionRubberBand.cpp

示例2: qtscript_QComboBox_SizeAdjustPolicy_toScriptValue

static QScriptValue qtscript_QComboBox_SizeAdjustPolicy_toScriptValue(QScriptEngine *engine, const QComboBox::SizeAdjustPolicy &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QComboBox"));
    return clazz.property(qtscript_QComboBox_SizeAdjustPolicy_toStringHelper(value));
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:5,代码来源:qtscript_QComboBox.cpp

示例3: qtscript_QPrintEngine_PrintEnginePropertyKey_toScriptValue

static QScriptValue qtscript_QPrintEngine_PrintEnginePropertyKey_toScriptValue(QScriptEngine *engine, const QPrintEngine::PrintEnginePropertyKey &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QPrintEngine"));
    return clazz.property(qtscript_QPrintEngine_PrintEnginePropertyKey_toStringHelper(value));
}
开发者ID:ppiecuch,项目名称:qcad,代码行数:5,代码来源:qtscript_QPrintEngine.cpp

示例4: cursorFromScriptValue

/** Conversion function from QtScript cursor to KTextEditor::Cursor */
static void cursorFromScriptValue(const QScriptValue &obj, KTextEditor::Cursor &cursor)
{
  cursor.setPosition(obj.property("line").toInt32(),
                     obj.property("column").toInt32());
}
开发者ID:fagu,项目名称:kileip,代码行数:6,代码来源:script.cpp

示例5:

static QScriptValue qtscript_QStyleOptionProgressBarV2_StyleOptionVersion_toScriptValue(QScriptEngine *engine, const QStyleOptionProgressBarV2::StyleOptionVersion &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QStyleOptionProgressBarV2"));
    return clazz.property(qtscript_QStyleOptionProgressBarV2_StyleOptionVersion_toStringHelper(value));
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:5,代码来源:qtscript_QStyleOptionProgressBarV2.cpp

示例6: vec2FromScriptValue

void vec2FromScriptValue(const QScriptValue &object, glm::vec2 &vec2) {
    vec2.x = object.property("x").toVariant().toFloat();
    vec2.y = object.property("y").toVariant().toFloat();
}
开发者ID:CoderPaulK,项目名称:hifi,代码行数:4,代码来源:RegisteredMetaTypes.cpp

示例7: qtscript_QGradient_CoordinateMode_toScriptValue

static QScriptValue qtscript_QGradient_CoordinateMode_toScriptValue(QScriptEngine *engine, const QGradient::CoordinateMode &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QGradient"));
    return clazz.property(qtscript_QGradient_CoordinateMode_toStringHelper(value));
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:5,代码来源:qtscript_QGradient.cpp

示例8: qtscript_QtConcurrent_ThreadFunctionResult_toScriptValue

static QScriptValue qtscript_QtConcurrent_ThreadFunctionResult_toScriptValue(QScriptEngine *engine, const QtConcurrent::ThreadFunctionResult &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QtConcurrent"));
    return clazz.property(qtscript_QtConcurrent_ThreadFunctionResult_toStringHelper(value));
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:5,代码来源:qtscript_QtConcurrent.cpp

示例9: setProperties

void TextOverlay::setProperties(const QScriptValue& properties) {
    Overlay2D::setProperties(properties);
    _qmlElement->setX(_bounds.left());
    _qmlElement->setY(_bounds.top());
    _qmlElement->setWidth(_bounds.width());
    _qmlElement->setHeight(_bounds.height());
    _qmlElement->settextColor(toQmlColor(vec4(toGlm(_color), _alpha)));
    QScriptValue font = properties.property("font");
    if (font.isObject()) {
        if (font.property("size").isValid()) {
            setFontSize(font.property("size").toInt32());
        }
        QFont font(_qmlElement->fontFamily());
        font.setPixelSize(_qmlElement->fontSize());
        QFontMetrics fm(font);
        _qmlElement->setlineHeight(fm.lineSpacing() * 1.2);
    }

    QScriptValue text = properties.property("text");
    if (text.isValid()) {
        setText(text.toVariant().toString());
    }

    QScriptValue backgroundColor = properties.property("backgroundColor");
    if (backgroundColor.isValid()) {
        QScriptValue red = backgroundColor.property("red");
        QScriptValue green = backgroundColor.property("green");
        QScriptValue blue = backgroundColor.property("blue");
        if (red.isValid() && green.isValid() && blue.isValid()) {
            _backgroundColor.red = red.toVariant().toInt();
            _backgroundColor.green = green.toVariant().toInt();
            _backgroundColor.blue = blue.toVariant().toInt();
        }
    }

    if (properties.property("backgroundAlpha").isValid()) {
        _backgroundAlpha = properties.property("backgroundAlpha").toVariant().toFloat();
    }
    _qmlElement->setbackgroundColor(toQmlColor(vec4(toGlm(_backgroundColor), _backgroundAlpha)));

    if (properties.property("leftMargin").isValid()) {
        setLeftMargin(properties.property("leftMargin").toVariant().toInt());
    }

    if (properties.property("topMargin").isValid()) {
        setTopMargin(properties.property("topMargin").toVariant().toInt());
    }
}
开发者ID:bwent,项目名称:hifi,代码行数:48,代码来源:TextOverlay.cpp

示例10: qtscript_QStyleOptionMenuItem_MenuItemType_toScriptValue

static QScriptValue qtscript_QStyleOptionMenuItem_MenuItemType_toScriptValue(QScriptEngine *engine, const QStyleOptionMenuItem::MenuItemType &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QStyleOptionMenuItem"));
    return clazz.property(qtscript_QStyleOptionMenuItem_MenuItemType_toStringHelper(value));
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:5,代码来源:qtscript_QStyleOptionMenuItem.cpp

示例11: qtscript_QtConcurrent_ReduceOption_toScriptValue

static QScriptValue qtscript_QtConcurrent_ReduceOption_toScriptValue(QScriptEngine *engine, const QtConcurrent::ReduceOption &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QtConcurrent"));
    return clazz.property(qtscript_QtConcurrent_ReduceOption_toStringHelper(value));
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:5,代码来源:qtscript_QtConcurrent.cpp

示例12: qtscript_QPainterPath_ElementType_toScriptValue

static QScriptValue qtscript_QPainterPath_ElementType_toScriptValue(QScriptEngine *engine, const QPainterPath::ElementType &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QPainterPath"));
    return clazz.property(qtscript_QPainterPath_ElementType_toStringHelper(value));
}
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:5,代码来源:qtscript_QPainterPath.cpp

示例13: qtscript_QDockWidget_DockWidgetFeature_toScriptValue

static QScriptValue qtscript_QDockWidget_DockWidgetFeature_toScriptValue(QScriptEngine *engine, const QDockWidget::DockWidgetFeature &value)
{
    QScriptValue clazz = engine->globalObject().property(QString::fromLatin1("QDockWidget"));
    return clazz.property(qtscript_QDockWidget_DockWidgetFeature_toStringHelper(value));
}
开发者ID:DanielJSlick,项目名称:qcad,代码行数:5,代码来源:qtscript_QDockWidget.cpp

示例14: val

//! [0]


//! [1]
QScriptValue val(&myEngine, 123);
myObject.setProperty("myReadOnlyProperty", val, QScriptValue::ReadOnly);
//! [1]


//! [2]
QScriptEngine engine;
engine.evaluate("function fullName() { return this.firstName + ' ' + this.lastName; }");
engine.evaluate("somePerson = { firstName: 'John', lastName: 'Doe' }");

QScriptValue global = engine.globalObject();
QScriptValue fullName = global.property("fullName");
QScriptValue who = global.property("somePerson");
qDebug() << fullName.call(who).toString(); // "John Doe"

engine.evaluate("function cube(x) { return x * x * x; }");
QScriptValue cube = global.property("cube");
QScriptValueList args;
args << 3;
qDebug() << cube.call(QScriptValue(), args).toNumber(); // 27
//! [2]


//! [3]
QScriptValue myNativeFunction(QScriptContext *ctx, QScriptEngine *)
{
    QScriptValue otherFunction = ...;
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:31,代码来源:src_script_qscriptvalue.cpp

示例15: vec4FromScriptValue

void vec4FromScriptValue(const QScriptValue& object, glm::vec4& vec4) {
    vec4.x = object.property("x").toVariant().toFloat();
    vec4.y = object.property("y").toVariant().toFloat();
    vec4.z = object.property("z").toVariant().toFloat();
    vec4.w = object.property("w").toVariant().toFloat();
}
开发者ID:CoderPaulK,项目名称:hifi,代码行数:6,代码来源:RegisteredMetaTypes.cpp


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