That's fine. I was curious if this was possible or not in the current state of QML2.
I do not yet have critical need for it but it could also be useful for overriding the valueOf prototype. I will just use another method to provide debug information about a QObject type. Thanks for the quick answer, Luke On 9 November 2015 at 09:10, Knoll Lars <[email protected]> wrote: > > On 08/11/15 22:57, "Development on behalf of Stephen Kelly" < > [email protected] on behalf of [email protected]> wrote: > > >Konstantin Ritt wrote: > > > >> Maybe JSON.stringify(obj) is what you need? > >> > > > >I think the intention is to override what that does using a specified > >method. > > JSON.stringify() does something slightly different than what you can do by > reimplementing toString(). > > For toString(), the default implementation for the object prototype will > currently get used. Implementing an invokable method on the wrapped QObject > would be nice, but currently there is some logic in the engine missing that > would allow that method to get picked up automatically. > > Cheers, > Lars > > > _______________________________________________ > Development mailing list > [email protected] > http://lists.qt-project.org/mailman/listinfo/development >
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
