I have a c++/qt application that I made scriptable via a QJSEngine my_eng
in which I expose my QWidget my_obj
via my_eng.globalObject().setProperty("my_obj", my_eng.newQObject(my_obj));
Now from within JS I can call all methods of my_obj
. I have a method getRect()
which returns a QRectF
and when I call it I get a good representation of it: QRectF(10, 10, 200, 200)
Now, if I store this a in variable my_rect
and try to access it via usual qt methods like my_rect.setWidth(11)
I get a
TypeError: Property 'setWidth' of object QRectF(10, 10, 200, 200) is not a function
Does someone know how to make all qt type available in QJSEngine
?