コード例 #1
0
ファイル: REcmaRuler.cpp プロジェクト: Alpha-Kand/qcad
         QScriptValue
        REcmaRuler::setOrientation
        (QScriptContext* context, QScriptEngine* engine) 
        
        {
            //REcmaHelper::functionStart("REcmaRuler::setOrientation", context, engine);
            //qDebug() << "ECMAScript WRAPPER: REcmaRuler::setOrientation";
            //QCoreApplication::processEvents();

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

                //Q_ASSERT(self!=NULL);
                if (self==NULL) {
                    return REcmaHelper::throwError("self is NULL", context);
                }
                
    
    if( context->argumentCount() ==
    1 && (
            context->argument(0).isNumber()
        ) /* type: Qt::Orientation */
    
    ){
    // prepare arguments:
    
                    // argument isStandardType
                    Qt::Orientation
                    a0 =
                    (Qt::Orientation)
                    (int)
                    context->argument( 0 ).
                    toNumber();
                
    // end of arguments

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


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