QCAD.org Forum

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).

adding a new property to a spline is done with a new item in the .ui file. This works fine, but when the line is drawn and afterwards selected, there is an other property edit window which shows only the original properties. How can I handle the need to edit the new property when the spline is selected?

New properties can only be added to an entity type in C++.This only makes sense for properties that are available for all instances of an entity type. For example, one could add a read-only property 'Length' to all spline entities.

User defined custom properties can be added to any object / entity if XData is enabled using the command line switch -enable-xdata:

./qcad -enable-xdata

XData support is experimental and therefore disabled by default. Custom properties that are attached to an entity are persistent (that means they are saved and can be read from DXF / DWG files).

// prints the value of a variable / object to stdout:qDebug(variable);

Starts QCAD with the script debugger enabled (useful to catch syntax errors, undefined objects, etc). Not for production use (crashes / undefined behavior may occur):

qcad -enable-script-debugger

Note that there are many script tools available that do similar things to what you are likely trying to achieve (for example Draw/Line/LineParallel/LineParallel.js allows the user to input a distance which is processed in the script in even handler LineParallel.prototype.slotDistanceChanged (since the UI component is called 'Distance').