Develop qcad by C++, not script

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

Moderator: andrew

Post Reply
liguosheng
Active Member
Posts: 33
Joined: Thu Jan 14, 2016 4:17 am

Develop qcad by C++, not script

Post by liguosheng » Sat Jan 16, 2016 2:03 pm

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?

User avatar
hungerburg
Premier Member
Posts: 160
Joined: Fri May 28, 2010 7:35 pm

Re: Develop qcad by C++, not script

Post by hungerburg » Sun Jan 17, 2016 12:47 am

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

liguosheng
Active Member
Posts: 33
Joined: Thu Jan 14, 2016 4:17 am

Re: Develop qcad by C++, not script

Post by liguosheng » Sun Jan 17, 2016 3:50 am

If i use qt creator, how can to set script debugger?

riverbuoy
Senior Member
Posts: 115
Joined: Thu Oct 03, 2013 5:37 pm

Re: Develop qcad by C++, not script

Post by riverbuoy » Wed Jan 20, 2016 2:08 pm

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

liguosheng
Active Member
Posts: 33
Joined: Thu Jan 14, 2016 4:17 am

Re: Develop qcad by C++, not script

Post by liguosheng » Wed Jan 20, 2016 2:41 pm

it's ok, thanks a lot.
:D

Post Reply

Return to “QCAD Developers and Contributors”