Page 1 of 1

QxEntityEditor - How to use custom files to extend entity?

PostPosted: Mon Jun 01, 2020 2:31 pm
by gigigi2002
Hello,
I am using QxEntityEditor to generate C++ code. Along with entities code it is also generating appropriate "custom" CPP and H files for every entity.
Assuming that these custom files can be used to extend functionality of the generated entities, what would be the best practice to do that if I need to add new methods, add another constructor or extend enumeration entity?
An example would be appreciated ;)
Thank you.

Re: QxEntityEditor - How to use custom files to extend entit

PostPosted: Mon Jun 01, 2020 2:46 pm
by qxorm
Hello,

About the custom directory, as explained in the QxEntityEditor manual (https://www.qxorm.com/qxorm_en/manual_q ... parameters) :
These custom files can be used for example to implement validation methods, or trigger functions.


You can also write every functions you want in custom files, but you can't add new methods or another constructor (because of C++ limitation compared to C# which supports partial classes).

So to add new methods / other constructors to an entity, I would recommend to use the QxEntityEditor Javascript engine to customize exports.
A documentation is here : https://www.qxorm.com/qxorm_en/manual_q ... #js_engine
There are sample scripts in QxEntityEditor package.