Page 1 of 1

Relation between core C++ Qt and its ECMAScript implementation

Posted: Wed Jun 05, 2019 3:02 pm
by garciadelcastillo
Hi there!

TL,DR: is there any documentation available about the ECMAScript bindings to Qt used for scripting on QCAD?

Description: I am curious if there is any documentation available about the JS-side API of the Qt C++ framework used for scripting. Qt looks quite powerful, and I like the idea of an ECMAScript-like API to access it. However, there are clear syntactical differences between the two languages, and it also looks like some of the core classes are not available JS-side (was trying to use QSet for example). Wondering if these issues are covered somewhere, or if there are dedicated ECMA docs about Qt.

Thanks!

Re: Relation between core C++ Qt and its ECMAScript implementation

Posted: Thu Jun 06, 2019 8:43 am
by andrew
The best way to discover the Qt ECMAScript API is probably through the vast number of example scripts in QCAD:
https://github.com/qcad/qcad/tree/master/scripts

Chances are there is already something similar to whatever you're trying to do.
Almost the entire Qt API is covered apart from container classes like QSet, QList, QMap which can be easily implemented in ECMAScript as object or array.