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


C++ QScriptEngine::setDefaultPrototype方法代码示例

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


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

示例1: init

                 void REcmaTextData::init(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RTextData*) 0)));
        protoCreated = true;
    }

    
        // primary base class RTextBasedData:
        
            QScriptValue dpt = engine.defaultPrototype(
                qMetaTypeId<RTextBasedData*>());

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    
    // copy:
    REcmaHelper::registerFunction(&engine, proto, copy, "copy");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class RTextBasedData
        REcmaHelper::registerFunction(&engine, proto, getRTextBasedData, "getRTextBasedData");
        
        // conversion for base class REntityData
        REcmaHelper::registerFunction(&engine, proto, getREntityData, "getREntityData");
        
        // conversion for base class RPainterPathSource
        REcmaHelper::registerFunction(&engine, proto, getRPainterPathSource, "getRPainterPathSource");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
        engine.setDefaultPrototype(
            qMetaTypeId<RTextData*>(), *proto);

        
                engine.setDefaultPrototype(qMetaTypeId<
                RTextData
                > (), *proto);
            
    

    QScriptValue ctor = engine.newFunction(create, *proto, 2);
    
    // static methods:
    

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RTextData",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:96,代码来源:REcmaTextData.cpp

示例2: initEcma

void REcmaViewFocusListenerAdapter::initEcma(QScriptEngine& engine, QScriptValue* proto

                                            )

{

    bool protoCreated = false;
    if(proto == NULL) {
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                                     (RViewFocusListenerAdapter*) 0)));
        protoCreated = true;
    }


    // primary base class RViewFocusListener:

    QScriptValue dpt = engine.defaultPrototype(
                           qMetaTypeId<RViewFocusListener*>());

    if (dpt.isValid()) {
        proto->setPrototype(dpt);
    }

    /*

    */


    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");


    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");

    // conversion for base class RViewFocusListener
    REcmaHelper::registerFunction(&engine, proto, getRViewFocusListener, "getRViewFocusListener");


    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");


    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");


    // properties:


    // methods:

    REcmaHelper::registerFunction(&engine, proto, updateFocus, "updateFocus");

    engine.setDefaultPrototype(
        qMetaTypeId<RViewFocusListenerAdapter*>(), *proto);




    QScriptValue ctor = engine.newFunction(create, *proto, 2);

    // static methods:


    // static properties:


    // enum values:


    // enum conversions:


    // init class:
    engine.globalObject().setProperty("RViewFocusListenerAdapter",
                                      ctor, QScriptValue::SkipInEnumeration);

    if( protoCreated ) {
        delete proto;
    }

}
开发者ID:Jackieee,项目名称:qcad,代码行数:85,代码来源:REcmaViewFocusListenerAdapter.cpp

示例3: init

        // includes for base ecma wrapper classes
         void REcmaObject::init(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RObject*) 0)));
        protoCreated = true;
    }

    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, clone, "clone");
            
            REcmaHelper::registerFunction(&engine, proto, getDocument, "getDocument");
            
            REcmaHelper::registerFunction(&engine, proto, setDocument, "setDocument");
            
            REcmaHelper::registerFunction(&engine, proto, getId, "getId");
            
            REcmaHelper::registerFunction(&engine, proto, getHandle, "getHandle");
            
            REcmaHelper::registerFunction(&engine, proto, isUndone, "isUndone");
            
            REcmaHelper::registerFunction(&engine, proto, setUndone, "setUndone");
            
            REcmaHelper::registerFunction(&engine, proto, getPropertyTypeIds, "getPropertyTypeIds");
            
            REcmaHelper::registerFunction(&engine, proto, getProperty, "getProperty");
            
            REcmaHelper::registerFunction(&engine, proto, setProperty, "setProperty");
            
            REcmaHelper::registerFunction(&engine, proto, hasPropertyType, "hasPropertyType");
            
            REcmaHelper::registerFunction(&engine, proto, isSelectedForPropertyEditing, "isSelectedForPropertyEditing");
            
            REcmaHelper::registerFunction(&engine, proto, getCustomProperty, "getCustomProperty");
            
            REcmaHelper::registerFunction(&engine, proto, setCustomProperty, "setCustomProperty");
            
            REcmaHelper::registerFunction(&engine, proto, removeCustomProperty, "removeCustomProperty");
            
            REcmaHelper::registerFunction(&engine, proto, getCustomPropertyKeys, "getCustomPropertyKeys");
            
            REcmaHelper::registerFunction(&engine, proto, getComplexity, "getComplexity");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RObject*>(), *proto);

        
    

    QScriptValue ctor = engine.newFunction(create, *proto, 2);
    
    // static methods:
    
            REcmaHelper::registerFunction(&engine, &ctor, init, "init");
            

    // static properties:
    
            ctor.setProperty("INVALID_ID",
                qScriptValueFromValue(&engine, RObject::INVALID_ID),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("INVALID_HANDLE",
                qScriptValueFromValue(&engine, RObject::INVALID_HANDLE),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyCustom",
                qScriptValueFromValue(&engine, RObject::PropertyCustom),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
//.........这里部分代码省略.........
开发者ID:VixMobile,项目名称:qcad,代码行数:101,代码来源:REcmaObject.cpp

示例4: initEcma

                 void REcmaDimDiametricData::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RDimDiametricData*) 0)));
        protoCreated = true;
    }

    
        // primary base class RDimensionData:
        
            QScriptValue dpt = engine.defaultPrototype(
                qMetaTypeId<RDimensionData*>());

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    
    // copy:
    REcmaHelper::registerFunction(&engine, proto, copy, "copy");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class RDimensionData
        REcmaHelper::registerFunction(&engine, proto, getRDimensionData, "getRDimensionData");
        
        // conversion for base class REntityData
        REcmaHelper::registerFunction(&engine, proto, getREntityData, "getREntityData");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, isValid, "isValid");
            
            REcmaHelper::registerFunction(&engine, proto, setChordPoint, "setChordPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getChordPoint, "getChordPoint");
            
            REcmaHelper::registerFunction(&engine, proto, setFarChordPoint, "setFarChordPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getFarChordPoint, "getFarChordPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getReferencePoints, "getReferencePoints");
            
            REcmaHelper::registerFunction(&engine, proto, moveReferencePoint, "moveReferencePoint");
            
            REcmaHelper::registerFunction(&engine, proto, move, "move");
            
            REcmaHelper::registerFunction(&engine, proto, rotate, "rotate");
            
            REcmaHelper::registerFunction(&engine, proto, scale, "scale");
            
            REcmaHelper::registerFunction(&engine, proto, mirror, "mirror");
            
            REcmaHelper::registerFunction(&engine, proto, getShapes, "getShapes");
            
            REcmaHelper::registerFunction(&engine, proto, getMeasuredValue, "getMeasuredValue");
            
            REcmaHelper::registerFunction(&engine, proto, getAutoLabel, "getAutoLabel");
            
            REcmaHelper::registerFunction(&engine, proto, updateTextData, "updateTextData");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RDimDiametricData*>(), *proto);

        
                engine.setDefaultPrototype(qMetaTypeId<
                RDimDiametricData
                > (), *proto);
            
    

//.........这里部分代码省略.........
开发者ID:Jackieee,项目名称:qcad,代码行数:101,代码来源:REcmaDimDiametricData.cpp

示例5: initEcma

                 void REcmaSharedPointerUcs::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RUcsPointer*) 0)));
        protoCreated = true;
    }

    
        // primary base class RObject:
        
            proto->setPrototype(engine.defaultPrototype(
            qMetaTypeId<RObjectPointer>()));
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    
        // shared pointer support:
        REcmaHelper::registerFunction(&engine, proto, data, "data");
        

        REcmaHelper::registerFunction(&engine, proto, isNull, "isNull");
        

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class RObject
        REcmaHelper::registerFunction(&engine, proto, getRObject, "getRObject");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, getType, "getType");
            
            REcmaHelper::registerFunction(&engine, proto, clone, "clone");
            
            REcmaHelper::registerFunction(&engine, proto, isSelectedForPropertyEditing, "isSelectedForPropertyEditing");
            
            REcmaHelper::registerFunction(&engine, proto, getProperty, "getProperty");
            
            REcmaHelper::registerFunction(&engine, proto, setProperty, "setProperty");
            
            REcmaHelper::registerFunction(&engine, proto, setOrigin, "setOrigin");
            
            REcmaHelper::registerFunction(&engine, proto, setXAxisDirection, "setXAxisDirection");
            
            REcmaHelper::registerFunction(&engine, proto, setYAxisDirection, "setYAxisDirection");
            
            REcmaHelper::registerFunction(&engine, proto, getZAxisDirection, "getZAxisDirection");
            
            REcmaHelper::registerFunction(&engine, proto, mapFromUcs, "mapFromUcs");
            
            REcmaHelper::registerFunction(&engine, proto, mapToUcs, "mapToUcs");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RUcsPointer>(), *proto);
      
    

    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);
    
    // static methods:
    
            REcmaHelper::registerFunction(&engine, &ctor, init, "init");
            

    // static properties:
    
            ctor.setProperty("PropertyName",
                qScriptValueFromValue(&engine, RUcs::PropertyName),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyOriginX",
                qScriptValueFromValue(&engine, RUcs::PropertyOriginX),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例6: initEcma

        // includes for base ecma wrapper classes
         void REcmaMathLineEdit::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RMathLineEdit*) 0)));
        protoCreated = true;
    }

    
        // primary base class QLineEdit:
        
            QScriptValue dpt = engine.defaultPrototype(
                qMetaTypeId<QLineEdit*>());

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class QLineEdit
        REcmaHelper::registerFunction(&engine, proto, getQLineEdit, "getQLineEdit");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, isAngle, "isAngle");
            
            REcmaHelper::registerFunction(&engine, proto, setAngle, "setAngle");
            
            REcmaHelper::registerFunction(&engine, proto, isInteger, "isInteger");
            
            REcmaHelper::registerFunction(&engine, proto, setInteger, "setInteger");
            
            REcmaHelper::registerFunction(&engine, proto, setValue, "setValue");
            
            REcmaHelper::registerFunction(&engine, proto, getValue, "getValue");
            
            REcmaHelper::registerFunction(&engine, proto, getError, "getError");
            
            REcmaHelper::registerFunction(&engine, proto, clearError, "clearError");
            
            REcmaHelper::registerFunction(&engine, proto, isValid, "isValid");
            
            REcmaHelper::registerFunction(&engine, proto, setToolTip, "setToolTip");
            
            REcmaHelper::registerFunction(&engine, proto, slotTextChanged, "slotTextChanged");
            
            REcmaHelper::registerFunction(&engine, proto, slotTextEdited, "slotTextEdited");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RMathLineEdit*>(), *proto);

        
                        qScriptRegisterMetaType<
                        RMathLineEdit*>(
                        &engine, toScriptValue, fromScriptValue, *proto);
                    
    

    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);
    
    // static methods:
    

    // static properties:
    

    // enum values:
    

//.........这里部分代码省略.........
开发者ID:fallenwind,项目名称:qcad,代码行数:101,代码来源:REcmaMathLineEdit.cpp

示例7: initEcma

                 void REcmaDeleteSelectionOperation::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RDeleteSelectionOperation*) 0)));
        protoCreated = true;
    }

    
        // primary base class RClipboardOperation:
        
            QScriptValue dpt = engine.defaultPrototype(
                qMetaTypeId<RClipboardOperation*>());

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class RClipboardOperation
        REcmaHelper::registerFunction(&engine, proto, getRClipboardOperation, "getRClipboardOperation");
        
        // conversion for base class ROperation
        REcmaHelper::registerFunction(&engine, proto, getROperation, "getROperation");
        
        // conversion for base class RRequireHeap
        REcmaHelper::registerFunction(&engine, proto, getRRequireHeap, "getRRequireHeap");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, apply, "apply");
            
            REcmaHelper::registerFunction(&engine, proto, preview, "preview");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RDeleteSelectionOperation*>(), *proto);

        
    

    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);
    
    // static methods:
    

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RDeleteSelectionOperation",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
开发者ID:fallenwind,项目名称:qcad,代码行数:93,代码来源:REcmaDeleteSelectionOperation.cpp

示例8: initEcma

        // includes for base ecma wrapper classes
         void REcmaSharedPointerDirected::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RDirectedPointer*) 0)));
        protoCreated = true;
    }

    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    
        // shared pointer support:
        REcmaHelper::registerFunction(&engine, proto, data, "data");
        

        REcmaHelper::registerFunction(&engine, proto, isNull, "isNull");
        

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, getDirection1, "getDirection1");
            
            REcmaHelper::registerFunction(&engine, proto, getDirection2, "getDirection2");
            
            REcmaHelper::registerFunction(&engine, proto, getSideOfPoint, "getSideOfPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getStartPoint, "getStartPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getEndPoint, "getEndPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getMiddlePoint, "getMiddlePoint");
            
            REcmaHelper::registerFunction(&engine, proto, reverse, "reverse");
            
            REcmaHelper::registerFunction(&engine, proto, trimStartPoint, "trimStartPoint");
            
            REcmaHelper::registerFunction(&engine, proto, trimEndPoint, "trimEndPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getTrimEnd, "getTrimEnd");
            
            REcmaHelper::registerFunction(&engine, proto, getDistanceFromStart, "getDistanceFromStart");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RDirectedPointer>(), *proto);
      
    

    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);
    
    // static methods:
    

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RDirectedPointer",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
开发者ID:fallenwind,项目名称:qcad,代码行数:95,代码来源:REcmaSharedPointerDirected.cpp

示例9: init

                 void REcmaSharedPointerLinetype::init(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RLinetypePointer*) 0)));
        protoCreated = true;
    }

    
        // primary base class RObject:
        
            proto->setPrototype(engine.defaultPrototype(
            qMetaTypeId<RObjectPointer>()));
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    
    // copy:
    REcmaHelper::registerFunction(&engine, proto, copy, "copy");
    
        // shared pointer support:
        REcmaHelper::registerFunction(&engine, proto, data, "data");
        

        REcmaHelper::registerFunction(&engine, proto, isNull, "isNull");
        

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class RObject
        REcmaHelper::registerFunction(&engine, proto, getRObject, "getRObject");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, clone, "clone");
            
            REcmaHelper::registerFunction(&engine, proto, getName, "getName");
            
            REcmaHelper::registerFunction(&engine, proto, setName, "setName");
            
            REcmaHelper::registerFunction(&engine, proto, isValid, "isValid");
            
            REcmaHelper::registerFunction(&engine, proto, getProperty, "getProperty");
            
            REcmaHelper::registerFunction(&engine, proto, setProperty, "setProperty");
            
            REcmaHelper::registerFunction(&engine, proto, isSelectedForPropertyEditing, "isSelectedForPropertyEditing");
            
            REcmaHelper::registerFunction(&engine, proto, equals, "equals");
            
            REcmaHelper::registerFunction(&engine, proto, operator_not_assign, "operator_not_assign");
            
            REcmaHelper::registerFunction(&engine, proto, operator_less, "operator_less");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RLinetypePointer>(), *proto);
      
    

    QScriptValue ctor = engine.newFunction(create, *proto, 2);
    
    // static methods:
    
            REcmaHelper::registerFunction(&engine, &ctor, init, "init");
            
            REcmaHelper::registerFunction(&engine, &ctor, getList, "getList");
            
            REcmaHelper::registerFunction(&engine, &ctor, getIcon, "getIcon");
            
            REcmaHelper::registerFunction(&engine, &ctor, getTitle, "getTitle");
            

    // static properties:
    
            ctor.setProperty("PropertyName",
//.........这里部分代码省略.........
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:101,代码来源:REcmaSharedPointerLinetype.cpp

示例10: initEcma

        // includes for base ecma wrapper classes
         void REcmaFileImporterRegistry::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RFileImporterRegistry*) 0)));
        protoCreated = true;
    }

    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
        engine.setDefaultPrototype(
            qMetaTypeId<RFileImporterRegistry*>(), *proto);

        
    

    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);
    
    // static methods:
    
            REcmaHelper::registerFunction(&engine, &ctor, registerFileImporter, "registerFileImporter");
            
            REcmaHelper::registerFunction(&engine, &ctor, unregisterFileImporter, "unregisterFileImporter");
            
            REcmaHelper::registerFunction(&engine, &ctor, getFileImporter, "getFileImporter");
            
            REcmaHelper::registerFunction(&engine, &ctor, getFilterStrings, "getFilterStrings");
            
            REcmaHelper::registerFunction(&engine, &ctor, hasFileImporter, "hasFileImporter");
            
            REcmaHelper::registerFunction(&engine, &ctor, getFilterExtensions, "getFilterExtensions");
            
            REcmaHelper::registerFunction(&engine, &ctor, getFilterExtensionPatterns, "getFilterExtensionPatterns");
            

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RFileImporterRegistry",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
开发者ID:fallenwind,项目名称:qcad,代码行数:82,代码来源:REcmaFileImporterRegistry.cpp

示例11: init

        // includes for base ecma wrapper classes
         void REcmaDebug::init(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RDebug*) 0)));
        protoCreated = true;
    }

    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
        engine.setDefaultPrototype(
            qMetaTypeId<RDebug*>(), *proto);

        
    

    QScriptValue ctor = engine.newFunction(create, *proto, 2);
    
    // static methods:
    
            REcmaHelper::registerFunction(&engine, &ctor, printBacktrace, "printBacktrace");
            
            REcmaHelper::registerFunction(&engine, &ctor, startTimer, "startTimer");
            
            REcmaHelper::registerFunction(&engine, &ctor, stopTimer, "stopTimer");
            

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RDebug",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
开发者ID:DanielJSlick,项目名称:qcad,代码行数:74,代码来源:REcmaDebug.cpp

示例12: initEcma

void REcmaTextEntity::initEcma(QScriptEngine& engine, QScriptValue* proto

                              )

{

    bool protoCreated = false;
    if(proto == NULL) {
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                                     (RTextEntity*) 0)));
        protoCreated = true;
    }


    // primary base class RTextBasedEntity:

    QScriptValue dpt = engine.defaultPrototype(
                           qMetaTypeId<RTextBasedEntity*>());

    if (dpt.isValid()) {
        proto->setPrototype(dpt);
    }

    /*

    */


    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");


    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");

    // conversion for base class RTextBasedEntity
    REcmaHelper::registerFunction(&engine, proto, getRTextBasedEntity, "getRTextBasedEntity");

    // conversion for base class REntity
    REcmaHelper::registerFunction(&engine, proto, getREntity, "getREntity");

    // conversion for base class RObject
    REcmaHelper::registerFunction(&engine, proto, getRObject, "getRObject");


    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");


    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");


    // properties:


    // methods:

    REcmaHelper::registerFunction(&engine, proto, clone, "clone");

    REcmaHelper::registerFunction(&engine, proto, getType, "getType");

    REcmaHelper::registerFunction(&engine, proto, getData, "getData");

    REcmaHelper::registerFunction(&engine, proto, setData, "setData");

    engine.setDefaultPrototype(
        qMetaTypeId<RTextEntity*>(), *proto);




    QScriptValue ctor = engine.newFunction(create, *proto, 2);

    // static methods:

    REcmaHelper::registerFunction(&engine, &ctor, init, "init");

    REcmaHelper::registerFunction(&engine, &ctor, getStaticPropertyTypeIds, "getStaticPropertyTypeIds");


    // static properties:

    ctor.setProperty("PropertyCustom",
                     qScriptValueFromValue(&engine, RTextEntity::PropertyCustom),
                     QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);

    ctor.setProperty("PropertyHandle",
                     qScriptValueFromValue(&engine, RTextEntity::PropertyHandle),
                     QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);

    ctor.setProperty("PropertyProtected",
                     qScriptValueFromValue(&engine, RTextEntity::PropertyProtected),
                     QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);

    ctor.setProperty("PropertyType",
                     qScriptValueFromValue(&engine, RTextEntity::PropertyType),
                     QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
//.........这里部分代码省略.........
开发者ID:Jackieee,项目名称:qcad,代码行数:101,代码来源:REcmaTextEntity.cpp

示例13: initEcma

void REcmaBlock::initEcma(QScriptEngine& engine, QScriptValue* proto

                         )

{

    bool protoCreated = false;
    if(proto == NULL) {
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                                     (RBlock*) 0)));
        protoCreated = true;
    }


    // primary base class RObject:

    QScriptValue dpt = engine.defaultPrototype(
                           qMetaTypeId<RObject*>());

    if (dpt.isValid()) {
        proto->setPrototype(dpt);
    }

    /*

    */


    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");


    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");

    // conversion for base class RObject
    REcmaHelper::registerFunction(&engine, proto, getRObject, "getRObject");


    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");


    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");


    // properties:


    // methods:

    REcmaHelper::registerFunction(&engine, proto, getType, "getType");

    REcmaHelper::registerFunction(&engine, proto, clone, "clone");

    REcmaHelper::registerFunction(&engine, proto, getName, "getName");

    REcmaHelper::registerFunction(&engine, proto, setName, "setName");

    REcmaHelper::registerFunction(&engine, proto, isFrozen, "isFrozen");

    REcmaHelper::registerFunction(&engine, proto, setFrozen, "setFrozen");

    REcmaHelper::registerFunction(&engine, proto, isAnonymous, "isAnonymous");

    REcmaHelper::registerFunction(&engine, proto, setAnonymous, "setAnonymous");

    REcmaHelper::registerFunction(&engine, proto, setOrigin, "setOrigin");

    REcmaHelper::registerFunction(&engine, proto, getOrigin, "getOrigin");

    REcmaHelper::registerFunction(&engine, proto, getProperty, "getProperty");

    REcmaHelper::registerFunction(&engine, proto, setProperty, "setProperty");

    REcmaHelper::registerFunction(&engine, proto, isSelectedForPropertyEditing, "isSelectedForPropertyEditing");

    engine.setDefaultPrototype(
        qMetaTypeId<RBlock*>(), *proto);




    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);

    // static methods:

    REcmaHelper::registerFunction(&engine, &ctor, init, "init");


    // static properties:

    ctor.setProperty("PropertyCustom",
                     qScriptValueFromValue(&engine, RBlock::PropertyCustom),
                     QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);

    ctor.setProperty("PropertyName",
//.........这里部分代码省略.........
开发者ID:ppiecuch,项目名称:qcad,代码行数:101,代码来源:REcmaBlock.cpp

示例14: initEcma

                 void REcmaDimRadialEntity::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RDimRadialEntity*) 0)));
        protoCreated = true;
    }

    
        // primary base class RDimensionEntity:
        
            QScriptValue dpt = engine.defaultPrototype(
                qMetaTypeId<RDimensionEntity*>());

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class RDimensionEntity
        REcmaHelper::registerFunction(&engine, proto, getRDimensionEntity, "getRDimensionEntity");
        
        // conversion for base class REntity
        REcmaHelper::registerFunction(&engine, proto, getREntity, "getREntity");
        
        // conversion for base class RObject
        REcmaHelper::registerFunction(&engine, proto, getRObject, "getRObject");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, clone, "clone");
            
            REcmaHelper::registerFunction(&engine, proto, getType, "getType");
            
            REcmaHelper::registerFunction(&engine, proto, setProperty, "setProperty");
            
            REcmaHelper::registerFunction(&engine, proto, getProperty, "getProperty");
            
            REcmaHelper::registerFunction(&engine, proto, getData, "getData");
            
            REcmaHelper::registerFunction(&engine, proto, setData, "setData");
            
            REcmaHelper::registerFunction(&engine, proto, setChordPoint, "setChordPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getChordPoint, "getChordPoint");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RDimRadialEntity*>(), *proto);

        
    

    QScriptValue ctor = engine.newFunction(createEcma, *proto, 2);
    
    // static methods:
    
            REcmaHelper::registerFunction(&engine, &ctor, init, "init");
            
            REcmaHelper::registerFunction(&engine, &ctor, getStaticPropertyTypeIds, "getStaticPropertyTypeIds");
            

    // static properties:
    
            ctor.setProperty("PropertyCustom",
                qScriptValueFromValue(&engine, RDimRadialEntity::PropertyCustom),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
            
            ctor.setProperty("PropertyHandle",
                qScriptValueFromValue(&engine, RDimRadialEntity::PropertyHandle),
                QScriptValue::SkipInEnumeration | QScriptValue::ReadOnly);
//.........这里部分代码省略.........
开发者ID:fallenwind,项目名称:qcad,代码行数:101,代码来源:REcmaDimRadialEntity.cpp

示例15: initEcma

        // includes for base ecma wrapper classes
         void REcmaWebView::initEcma(QScriptEngine& engine, QScriptValue* proto 
    
    ) 
    
    {

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RWebView*) 0)));
        protoCreated = true;
    }

    
        // primary base class QWebView:
        
            QScriptValue dpt = engine.defaultPrototype(
                qMetaTypeId<QWebView*>());

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        
        */
    

    QScriptValue fun;

    // toString:
    REcmaHelper::registerFunction(&engine, proto, toString, "toString");
    

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class QWebView
        REcmaHelper::registerFunction(&engine, proto, getQWebView, "getQWebView");
        

    // get class name
    REcmaHelper::registerFunction(&engine, proto, getClassName, "getClassName");
    

    // conversion to all base classes (multiple inheritance):
    REcmaHelper::registerFunction(&engine, proto, getBaseClasses, "getBaseClasses");
    

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, sizeHint, "sizeHint");
            
            REcmaHelper::registerFunction(&engine, proto, minimumSizeHint, "minimumSizeHint");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RWebView*>(), *proto);

        
                        qScriptRegisterMetaType<
                        RWebView*>(
                        &engine, toScriptValue, fromScriptValue, *proto);
                    
    

    QScriptValue ctor = engine.newFunction(create, *proto, 2);
    
    // static methods:
    

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RWebView",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
    }
开发者ID:Jackieee,项目名称:qcad,代码行数:92,代码来源:REcmaWebView.cpp


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