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


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

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


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

示例1: initEcma

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

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

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

    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 RXLine
        REcmaHelper::registerFunction(&engine, proto, getRXLine, "getRXLine");
        
        // conversion for base class RShape
        REcmaHelper::registerFunction(&engine, proto, getRShape, "getRShape");
        
        // conversion for base class RDirected
        REcmaHelper::registerFunction(&engine, proto, getRDirected, "getRDirected");
        

    // 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, trimEndPoint, "trimEndPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getPointsWithDistanceToEnd, "getPointsWithDistanceToEnd");
            
            REcmaHelper::registerFunction(&engine, proto, reverse, "reverse");
            
            REcmaHelper::registerFunction(&engine, proto, getClippedLine, "getClippedLine");
            
            REcmaHelper::registerFunction(&engine, proto, getVectorTo, "getVectorTo");
            
            REcmaHelper::registerFunction(&engine, proto, stretch, "stretch");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RRayPointer>(), *proto);
      
    

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

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RRayPointer",
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例2: 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

示例3: initEcma

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

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RTransformation*) 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<RTransformation*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

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

示例4: initEcma

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

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

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

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        REcmaRuler::initEcma(engine, proto);
          REcmaCoordinateListener::initEcma(engine, proto);
          
        */
    

    QScriptValue fun;

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

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class QFrame
        REcmaHelper::registerFunction(&engine, proto, getQFrame, "getQFrame");
        
        // conversion for base class RRuler
        REcmaHelper::registerFunction(&engine, proto, getRRuler, "getRRuler");
        
        // conversion for base class RCoordinateListener
        REcmaHelper::registerFunction(&engine, proto, getRCoordinateListener, "getRCoordinateListener");
        

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

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

        // properties of secondary base class RRuler:
        

        // methods of secondary base class RRuler:
        
            REcmaHelper::registerFunction(&engine, proto, setGraphicsView, "setGraphicsView");
            
            REcmaHelper::registerFunction(&engine, proto, getOrientation, "getOrientation");
            

        // properties of secondary base class RCoordinateListener:
        

        // methods of secondary base class RCoordinateListener:
        

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, setOrientation, "setOrientation");
            
            REcmaHelper::registerFunction(&engine, proto, sizeHint, "sizeHint");
            
            REcmaHelper::registerFunction(&engine, proto, paintTick, "paintTick");
            
            REcmaHelper::registerFunction(&engine, proto, getFont, "getFont");
            
            REcmaHelper::registerFunction(&engine, proto, updateViewport, "updateViewport");
            
            REcmaHelper::registerFunction(&engine, proto, updateCoordinate, "updateCoordinate");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RRulerQt*>(), *proto);

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

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

示例5: initEcma

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

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

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

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        REcmaExportListener::initEcma(engine, proto);
          
        */
    

    QScriptValue fun;

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

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // conversion for base class QObject
        REcmaHelper::registerFunction(&engine, proto, getQObject, "getQObject");
        
        // conversion for base class RExportListener
        REcmaHelper::registerFunction(&engine, proto, getRExportListener, "getRExportListener");
        

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

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

        // properties of secondary base class RExportListener:
        

        // methods of secondary base class RExportListener:
        

    // properties:
    

    // methods:
    
            REcmaHelper::registerFunction(&engine, proto, preExportEvent, "preExportEvent");
            
            REcmaHelper::registerFunction(&engine, proto, postExportEvent, "postExportEvent");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RExportListenerAdapter*>(), *proto);

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

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

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RExportListenerAdapter",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
    
//.........这里部分代码省略.........
开发者ID:ppiecuch,项目名称:qcad,代码行数:101,代码来源:REcmaExportListenerAdapter.cpp

示例6: initEcma

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

                              )

{

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


    // primary base class QMdiSubWindow:

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

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

    /*
    REcmaModifiedListener::initEcma(engine, proto);

    */


    QScriptValue fun;

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


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

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

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


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


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


    // properties of secondary base class RModifiedListener:


    // methods of secondary base class RModifiedListener:


    // properties:


    // methods:

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

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

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

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

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

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

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

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

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


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



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

    // static methods:


    // static properties:


    // enum values:

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

示例7: initEcma

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

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

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

            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 RSnapRestriction
        REcmaHelper::registerFunction(&engine, proto, getRSnapRestriction, "getRSnapRestriction");
        

    // 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, restrictSnap, "restrictSnap");
            
            REcmaHelper::registerFunction(&engine, proto, setBaseAngle, "setBaseAngle");
            
            REcmaHelper::registerFunction(&engine, proto, setAngle, "setAngle");
            
            REcmaHelper::registerFunction(&engine, proto, setBaseLength, "setBaseLength");
            
            REcmaHelper::registerFunction(&engine, proto, setLength, "setLength");
            
            REcmaHelper::registerFunction(&engine, proto, setRestrictAngle, "setRestrictAngle");
            
            REcmaHelper::registerFunction(&engine, proto, setRestrictLength, "setRestrictLength");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RRestrictAngleLength*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

    ctor.setProperty("None",
    QScriptValue(RRestrictAngleLength::None),
    QScriptValue::ReadOnly);


    ctor.setProperty("Angle",
    QScriptValue(RRestrictAngleLength::Angle),
    QScriptValue::ReadOnly);


    ctor.setProperty("Length",
    QScriptValue(RRestrictAngleLength::Length),
    QScriptValue::ReadOnly);


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

示例8: initEcma

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

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

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

            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 RPatternList
        REcmaHelper::registerFunction(&engine, proto, getRPatternList, "getRPatternList");
        

    // 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<RPatternListMetric*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

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

示例9: run

void Agent::run() {
    NodeList* nodeList = NodeList::getInstance();
    nodeList->setOwnerType(NODE_TYPE_AGENT);
    
    const char AGENT_NODE_TYPES_OF_INTEREST[2] = { NODE_TYPE_VOXEL_SERVER, NODE_TYPE_AUDIO_MIXER };
    
    nodeList->setNodeTypesOfInterest(AGENT_NODE_TYPES_OF_INTEREST, sizeof(AGENT_NODE_TYPES_OF_INTEREST));

    nodeList->getNodeSocket()->setBlocking(false);
    
    // figure out the URL for the script for this agent assignment
    QString scriptURLString("http://%1:8080/assignment/%2");
    scriptURLString = scriptURLString.arg(NodeList::getInstance()->getDomainIP().toString(),
                                          uuidStringWithoutCurlyBraces(_uuid));
    
    // setup curl for script download
    CURLcode curlResult;
    
    CURL* curlHandle = curl_easy_init();
    
    // tell curl which file to grab
    curl_easy_setopt(curlHandle, CURLOPT_URL, scriptURLString.toStdString().c_str());
    
    // send the data to the WriteMemoryCallback function
    curl_easy_setopt(curlHandle, CURLOPT_WRITEFUNCTION, writeScriptDataToString);
    
    QString scriptContents;
    
    // pass the scriptContents QString to append data to
    curl_easy_setopt(curlHandle, CURLOPT_WRITEDATA, (void *)&scriptContents);
    
    // send a user agent since some servers will require it
    curl_easy_setopt(curlHandle, CURLOPT_USERAGENT, "libcurl-agent/1.0");
    
    // make sure CURL fails on a 400 code
    curl_easy_setopt(curlHandle, CURLOPT_FAILONERROR, true);
    
    qDebug() << "Downloading script at" << scriptURLString << "\n";
    
    // blocking get for JS file
    curlResult = curl_easy_perform(curlHandle);
  
    if (curlResult == CURLE_OK) {
        // cleanup curl
        curl_easy_cleanup(curlHandle);
        curl_global_cleanup();
        
        QScriptEngine engine;
        
        // register meta-type for glm::vec3 conversions
        qScriptRegisterMetaType(&engine, vec3toScriptValue, vec3FromScriptValue);
        
        QScriptValue agentValue = engine.newQObject(this);
        engine.globalObject().setProperty("Agent", agentValue);
        
        VoxelScriptingInterface voxelScripter;
        QScriptValue voxelScripterValue =  engine.newQObject(&voxelScripter);
        engine.globalObject().setProperty("Voxels", voxelScripterValue);
        
        QScriptValue treeScaleValue = engine.newVariant(QVariant(TREE_SCALE));
        engine.globalObject().setProperty("TREE_SCALE", treeScaleValue);

        // let the VoxelPacketSender know how frequently we plan to call it
        voxelScripter.getVoxelPacketSender()->setProcessCallIntervalHint(INJECT_INTERVAL_USECS);
        
        // hook in a constructor for audio injectorss
        AudioInjector scriptedAudioInjector(BUFFER_LENGTH_SAMPLES_PER_CHANNEL);
        QScriptValue audioInjectorValue = engine.newQObject(&scriptedAudioInjector);
        engine.globalObject().setProperty("AudioInjector", audioInjectorValue);
        
        qDebug() << "Downloaded script:" << scriptContents << "\n";
        QScriptValue result = engine.evaluate(scriptContents);
        qDebug() << "Evaluated script.\n";
        
        if (engine.hasUncaughtException()) {
            int line = engine.uncaughtExceptionLineNumber();
            qDebug() << "Uncaught exception at line" << line << ":" << result.toString() << "\n";
        }
        
        timeval startTime;
        gettimeofday(&startTime, NULL);
        
        timeval lastDomainServerCheckIn = {};
        
        sockaddr_in senderAddress;
        unsigned char receivedData[MAX_PACKET_SIZE];
        ssize_t receivedBytes;
        
        int thisFrame = 0;
        
        NodeList::getInstance()->startSilentNodeRemovalThread();
        
        while (!_shouldStop) {
            
            // if we're not hearing from the domain-server we should stop running
            if (NodeList::getInstance()->getNumNoReplyDomainCheckIns() == MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {
                break;
            }
            
            // send a check in packet to the domain server if DOMAIN_SERVER_CHECK_IN_USECS has elapsed
//.........这里部分代码省略.........
开发者ID:digi-chris,项目名称:hifi,代码行数:101,代码来源:Agent.cpp

示例10: initEcma

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

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

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

            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 RSpatialIndex
        REcmaHelper::registerFunction(&engine, proto, getRSpatialIndex, "getRSpatialIndex");
        
        // 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, clear, "clear");
            
            REcmaHelper::registerFunction(&engine, proto, bulkLoad, "bulkLoad");
            
            REcmaHelper::registerFunction(&engine, proto, addToIndex, "addToIndex");
            
            REcmaHelper::registerFunction(&engine, proto, removeFromIndex, "removeFromIndex");
            
            REcmaHelper::registerFunction(&engine, proto, queryIntersected, "queryIntersected");
            
            REcmaHelper::registerFunction(&engine, proto, queryIntersectedSimple, "queryIntersectedSimple");
            
            REcmaHelper::registerFunction(&engine, proto, queryContained, "queryContained");
            
            REcmaHelper::registerFunction(&engine, proto, queryNearestNeighbor, "queryNearestNeighbor");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RSpatialIndexNavel*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RSpatialIndexNavel",
    ctor, QScriptValue::SkipInEnumeration);
    
    if( protoCreated ){
       delete proto;
    }
//.........这里部分代码省略.........
开发者ID:Jackieee,项目名称:qcad,代码行数:101,代码来源:REcmaSpatialIndexNavel.cpp

示例11: initEcma

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

    bool protoCreated = false;
    if(proto == NULL){
        proto = new QScriptValue(engine.newVariant(qVariantFromValue(
                (RImporter*) 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, startImport, "startImport");
            
            REcmaHelper::registerFunction(&engine, proto, endImport, "endImport");
            
            REcmaHelper::registerFunction(&engine, proto, importObject, "importObject");
            
            REcmaHelper::registerFunction(&engine, proto, setCurrentBlockId, "setCurrentBlockId");
            
            REcmaHelper::registerFunction(&engine, proto, getCurrentBlockId, "getCurrentBlockId");
            
            REcmaHelper::registerFunction(&engine, proto, getDocument, "getDocument");
            
            REcmaHelper::registerFunction(&engine, proto, setDocument, "setDocument");
            
            REcmaHelper::registerFunction(&engine, proto, setKnownVariable, "setKnownVariable");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RImporter*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

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

示例12: init

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

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

    

    QScriptValue fun;

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

    // 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, set, "set");
            
            REcmaHelper::registerFunction(&engine, proto, isValid, "isValid");
            
            REcmaHelper::registerFunction(&engine, proto, getNumDashes, "getNumDashes");
            
            REcmaHelper::registerFunction(&engine, proto, getPatternLength, "getPatternLength");
            
            REcmaHelper::registerFunction(&engine, proto, getDashLengthAt, "getDashLengthAt");
            
            REcmaHelper::registerFunction(&engine, proto, getLargestGap, "getLargestGap");
            
            REcmaHelper::registerFunction(&engine, proto, hasDashAt, "hasDashAt");
            
            REcmaHelper::registerFunction(&engine, proto, getDelta, "getDelta");
            
            REcmaHelper::registerFunction(&engine, proto, isSymmetrical, "isSymmetrical");
            
            REcmaHelper::registerFunction(&engine, proto, scale, "scale");
            
            REcmaHelper::registerFunction(&engine, proto, operator_assign, "operator_assign");
            
            REcmaHelper::registerFunction(&engine, proto, equals, "equals");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RLinetypePattern*>(), *proto);

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

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

    // static properties:
    

    // enum values:
    

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

示例13: init

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

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

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

            if (dpt.isValid()) {
                proto->setPrototype(dpt);
            }
          
        /*
        REcmaPolyline::init(engine, proto);
          
        */
    

    QScriptValue fun;

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

    // destroy:
    REcmaHelper::registerFunction(&engine, proto, destroy, "destroy");
    
        // 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, castToShape, "castToShape");
            
            REcmaHelper::registerFunction(&engine, proto, getDimasz, "getDimasz");
            
            REcmaHelper::registerFunction(&engine, proto, getDimscale, "getDimscale");
            
            REcmaHelper::registerFunction(&engine, proto, setArrowHead, "setArrowHead");
            
            REcmaHelper::registerFunction(&engine, proto, hasArrowHead, "hasArrowHead");
            
            REcmaHelper::registerFunction(&engine, proto, getEndPoint, "getEndPoint");
            
            REcmaHelper::registerFunction(&engine, proto, getStartPoint, "getStartPoint");
            
            REcmaHelper::registerFunction(&engine, proto, countVertices, "countVertices");
            
            REcmaHelper::registerFunction(&engine, proto, countSegments, "countSegments");
            
            REcmaHelper::registerFunction(&engine, proto, appendVertex, "appendVertex");
            
            REcmaHelper::registerFunction(&engine, proto, getReferencePoints, "getReferencePoints");
            
            REcmaHelper::registerFunction(&engine, proto, moveReferencePoint, "moveReferencePoint");
            
            REcmaHelper::registerFunction(&engine, proto, getExploded, "getExploded");
            
            REcmaHelper::registerFunction(&engine, proto, getShapes, "getShapes");
            
            REcmaHelper::registerFunction(&engine, proto, getArrowShape, "getArrowShape");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RLeaderData*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
//.........这里部分代码省略.........
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:101,代码来源:REcmaLeaderData.cpp

示例14: 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

示例15: init

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

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

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

            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 RDimLinearData
        REcmaHelper::registerFunction(&engine, proto, getRDimLinearData, "getRDimLinearData");
        
        // 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, setRotation, "setRotation");
            
            REcmaHelper::registerFunction(&engine, proto, getRotation, "getRotation");
            
            REcmaHelper::registerFunction(&engine, proto, getReferencePoints, "getReferencePoints");
            
            REcmaHelper::registerFunction(&engine, proto, rotate, "rotate");
            
            REcmaHelper::registerFunction(&engine, proto, mirror, "mirror");
            
            REcmaHelper::registerFunction(&engine, proto, getShapes, "getShapes");
            
            REcmaHelper::registerFunction(&engine, proto, getMeasuredValue, "getMeasuredValue");
            
            REcmaHelper::registerFunction(&engine, proto, getAutoLabel, "getAutoLabel");
            
        engine.setDefaultPrototype(
            qMetaTypeId<RDimRotatedData*>(), *proto);

        
    

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

    // static properties:
    

    // enum values:
    

    // enum conversions:
    
        
    // init class:
    engine.globalObject().setProperty("RDimRotatedData",
//.........这里部分代码省略.........
开发者ID:Alpha-Kand,项目名称:qcad,代码行数:101,代码来源:REcmaDimRotatedData.cpp


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