ECMAScript manual

Discussion forum for contributors and developers who are using the QCAD version 3 ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

ECMAScript manual

Postby andrew » Thu Jul 10, 2014 10:09 pm

From a QCAD user:
Do you have a complete manual for ECMAScript that I can download to be sure I can do what I want?
User avatar
andrew
Site Admin
 
Posts: 2555
Joined: Fri Mar 30, 2007 6:07 am

Re: ECMAScript manual

Postby andrew » Thu Jul 10, 2014 10:13 pm

First, please note that 'ECMAScript' is the technically correct name for what is generally known as 'JavaScript'. Note that JavaScript is NOT Java and has nothing to do with Java at all, that's why I prefer the correct name 'ECMAScript'.

There are plenty of resources available on ECMAScript both online and as books. However, if you google for something related to ECMAScript, google the term 'JavaScript' instead to get more results.

You can find the QCAD API documentation at:
http://qcad.org/doc/qcad/latest/developer/

Since QCAD is based on the Qt framework, you can also access all Qt functionality from your scripts. The Qt API documentation:
http://qt-project.org/doc/qt-4.8/

Both that QCAD and the Qt APIs are pretty massive, so I recommend to mainly look at example code of tools similar to the one you need to get started. All tools offered by QCAD are to some degree implemented in ECMAScript, so you can find plenty of example code in the scripts directory of your QCAD installation or in our source code repository at:
https://github.com/qcad/qcad/tree/master/scripts
User avatar
andrew
Site Admin
 
Posts: 2555
Joined: Fri Mar 30, 2007 6:07 am

Re: ECMAScript manual

Postby hungerburg » Sun Jul 13, 2014 10:21 am

In addition to the API document, I have also found the built in debugger quite useful. Enable with a command line argument and trigger from your code with a statement. From a side panel I could drill through and see the available methods and fields in objects. Only useful, as long as the names speak for themselves, and mostly when one is exploring of course. Its a little like firebug in your favourite webbrowser though.
User avatar
hungerburg
Senior Member
 
Posts: 125
Joined: Fri May 28, 2010 7:35 pm


Return to QCAD 3 Developers and Contributors

Who is online

Users browsing this forum: Taygete and 1 guest