Beispiel #1
0
         QScriptValue
        REcmaFont::getNames
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaFont::getNames", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaFont::getNames";
            //QCoreApplication::processEvents();

            QScriptValue result = engine->undefinedValue();
            
                    // public function: can be called from ECMA wrapper of ECMA shell:
                    RFont* self = 
                        getSelf("getNames", context);
                  

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    0
    ){
    // prepare arguments:
    
    // end of arguments

    // call C++ function:
    // return type 'const QStringList'
    const QStringList cppResult =
        
               self->getNames();
        // return type: const QStringList
                // not standard type nor reference
                result = qScriptValueFromValue(engine, cppResult);
            
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RFont.getNames().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaFont::getNames", context, engine);
            return result;
        }