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

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

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isVariant() || 
            context->argument(0).isQObject() || 
            context->argument(0).isNull()
        ) /* type: RGraphicsView * */
    
    ){
    // prepare arguments:
    
                    // argument is pointer
                    RGraphicsView * a0 = NULL;

                    a0 = 
                        REcmaHelper::scriptValueTo<RGraphicsView >(
                            context->argument(0)
                        );
                    
                    if (a0==NULL && 
                        !context->argument(0).isNull()) {
                        return REcmaHelper::throwError("RRuler: Argument 0 is not of type RGraphicsView *RGraphicsView *.", context);                    
                    }
                
    // end of arguments

    // call C++ function:
    // return type 'void'
    
               self->setGraphicsView(a0);
    } else


        
            {
               return REcmaHelper::throwError("Wrong number/types of arguments for RRuler.setGraphicsView().",
                   context);
            }
            //REcmaHelper::functionEnd("REcmaRuler::setGraphicsView", context, engine);
            return result;
        }