Page 1 of 1

Develop qcad by C++, not script

Posted: Sat Jan 16, 2016 2:03 pm
by liguosheng
when i develop qcad by script, i can't set breakpoints for js files. can it be setted breakpoint?

so i write programme by c++, but i don't know how to create signals and slots.
for example, when a class is extended by RGraphicsViewQt, how to set drag and drop event or others?

Re: Develop qcad by C++, not script

Posted: Sun Jan 17, 2016 12:47 am
by hungerburg
liguosheng wrote:when i develop qcad by script, i can't set breakpoints for js files. can it be setted breakpoint?
In your script, put the expression "debugger;" to force a breakpoint; run QCAD from a terminal with the argument "-enable-script-debugger" or create a desktop shortcut with that, when on MS-windows. See viewtopic.php?f=32&t=2872

Re: Develop qcad by C++, not script

Posted: Sun Jan 17, 2016 3:50 am
by liguosheng
If i use qt creator, how can to set script debugger?

Re: Develop qcad by C++, not script

Posted: Wed Jan 20, 2016 2:08 pm
by riverbuoy
liguosheng wrote:If i use qt creator, how can to set script debugger?

In qt-creator you will see down the left hand side of the screen, pointers to different pages, e.g. Welcome, Edit etc. Choose the Projects page. This shows the kit used to build and run the project, e.g. Qt-4.8.4. Under the kit name there are two buttons - Build and Run. Click the run button. On that page there is an input box named Arguments. In this box enter '-enable-script-debugger'. This will start QCAD with the script debugger enabled. Place 'debugger' statements in your scripts to launch the script debugger at those points.

Hope this helps.

riverbuoy

Re: Develop qcad by C++, not script

Posted: Wed Jan 20, 2016 2:41 pm
by liguosheng
it's ok, thanks a lot.
:D