Hi trolls,

I'm trying to make a QPoint newable and modifyable from QtScript.

I've defined the "QPoint ctor" and "QPoint::setX" function in my script.
The QPoint constructs properly, but I can't seem to find the proper
implementation for setX(int x);

Qt Code:
  1. inline QScriptValue QPoint_setX(QScriptContext *ctx, QScriptEngine *eng)
  2. {
  3. QPoint object = ctx->thisObject().toVariant().toPoint();
  4.  
  5. if (ctx->argumentCount() == 1 && ctx->argument(0).isNumber())
  6. {
  7. object.setX(ctx->argument(0).toInt32());
  8.  
  9. // This doesn't seem to apply changes
  10. ctx->setThisObject(eng->newVariant(object));
  11. }
  12. return eng->undefinedValue();
  13. }
To copy to clipboard, switch view to plain text mode 

Is it possible to do such a thing ?