ECMAScript manual

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

ECMAScript manual

Post by 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: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: ECMAScript manual

Post by 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
hungerburg
Premier Member
Posts: 160
Joined: Fri May 28, 2010 7:35 pm

Re: ECMAScript manual

Post by 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.

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”