Re: [Interest] Creating C++ objects in JavaScript with operator new

2019-04-16 Thread Jérôme Godbout
perform a binding instead of value with the changed part. -Original Message- From: Richard Weickelt Sent: April 16, 2019 7:39 AM To: Jérôme Godbout ; interest@qt-project.org Subject: Re: [Interest] Creating C++ objects in JavaScript with operator new > You can also generate an ob

Re: [Interest] Creating C++ objects in JavaScript with operator new

2019-04-16 Thread Richard Weickelt
> You can also generate an object from Qml code directly: > Qt.createQmlObject() I know, but I wanted to use operator new in order to achieve a better look & feel. Please note that this is/was easily possible in Qt Script. See the code snippets at https://doc.qt.io/qt-5/qtscript-index.html#making

Re: [Interest] Creating C++ objects in JavaScript with operator new

2019-04-15 Thread Jérôme Godbout
You can expose the C++ object to metatype, then register the MetaObject using qmlRegisterType<>() to the Qml types. You then should create a Component and instanciate the component into an actual object: I strongly suggest you read this: https://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreat