/** * Stream operator for QDebug */ QDebug operator<<(QDebug dbg, const RView& v) { dbg.nospace() << "RView(" << (RObject&) v << ", name: " << v.getName() << ", centerPoint: " << v.getCenterPoint() << ", width: " << v.getWidth() << ", height: " << v.getHeight() << ")"; return dbg.space(); }
QScriptValue REcmaSharedPointerView::getName (QScriptContext* context, QScriptEngine* engine) { //REcmaHelper::functionStart("REcmaSharedPointerView::getName", context, engine); //qDebug() << "ECMAScript WRAPPER: REcmaSharedPointerView::getName"; //QCoreApplication::processEvents(); QScriptValue result = engine->undefinedValue(); // public function: can be called from ECMA wrapper of ECMA shell: RView* self = getSelf("getName", 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 'QString' QString cppResult = self->getName(); // return type: QString // standard Type result = QScriptValue(cppResult); } else { return REcmaHelper::throwError("Wrong number/types of arguments for RView.getName().", context); } //REcmaHelper::functionEnd("REcmaSharedPointerView::getName", context, engine); return result; }