Hi,
I recently purchased qcad pro licence , and now I want to extend RLineEntity class with new properties, my question have I to purchase C++ licence for doing this, and could you give me an example for doing that ?
Thanks for your orientation.
Extending class RLineEntity
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Re: Extending class RLineEntity
You can add custom properties to any entity (line, arc, dimension, etc) or other object (layer, block, etc.) using REntity::setCustomProperty
In the GUI, you can use the property editor to add / inspect custom properties.
You do not need a QCAD C++ Libraries license for this.
In the GUI, you can use the property editor to add / inspect custom properties.
You do not need a QCAD C++ Libraries license for this.
Re: Extending class RLineEntity
Hi,
I don't think custom properties feat my neads for these reasons :
-On base, my new properties will be added by applicaion not by user (some of will be presented in property editor and others no).
-New properties with boolean type, list of values, handle value for refercing onther object...
-Can not show a property in the edior.
-Not included in QCAD group.
That's why I think I'll need to add my new properties by C++.
Could you confrm me ?
Thanks.
I don't think custom properties feat my neads for these reasons :
-On base, my new properties will be added by applicaion not by user (some of will be presented in property editor and others no).
-New properties with boolean type, list of values, handle value for refercing onther object...
-Can not show a property in the edior.
-Not included in QCAD group.
That's why I think I'll need to add my new properties by C++.
Could you confrm me ?
Thanks.
Re: Extending class RLineEntity
There is no difference if you add properties using the ECMAScript interface or C++ (ECMAScript calls into C++).saibou wrote:That's why I think I'll need to add my new properties by C++.
QCAD supports custom string type properties to be attached to all objects (entities, layers, blocks). If this is not sufficient, you would have to add new properties to RObject or REntity or implement your own property system, i.e. modify RObject or REntity classes.
Re: Extending class RLineEntity
Yes string properties not sufficient for me.
So with your response to add new properties to RObject or REntity, I comeback to my question, have I to purchase C++ licence for doing that ?
So with your response to add new properties to RObject or REntity, I comeback to my question, have I to purchase C++ licence for doing that ?
Re: Extending class RLineEntity
Ideally, you can create all your extensions as a plugin which can be distributed under any license of your choice without the need for a QCAD C++ Libraries license.saibou wrote:So with your response to add new properties to RObject or REntity, I comeback to my question, have I to purchase C++ licence for doing that ?
If you modify the QCAD sources directly (i.e. change the REntity class or derived classes) you must distribute those changes under the GPLv3 (same as the QCAD source code). Again, you do not need a QCAD C++ Libraries license.
A QCAD C++ Libraries license is only needed if you require access to the source code of the QCAD Professional add-ons (DWG importer / exporter, QCAD Professional tools and algorithms, etc.).
Re: Extending class RLineEntity
Thanks for your response, I saw your plugin example. https://github.com/qcad/qcad/blob/maste ... in.cpp#L58
And what I want o achieve to change "MyClass" to extend from RLineEntity as :
How can I change EcmaMyClass::createMyClass in way to retreive document and data from *context for passing them as arguments in instanciation of MyClass ?
Thanks.
And what I want o achieve to change "MyClass" to extend from RLineEntity as :
Code: Select all
class MyClass : public RLineEntity {
public:
MyClass(RDocument* document, const RLineData& data) : RLineEntity(document, data) {}
virtual int getInt() const {
return i;
}
virtual double getDouble() const {
return d;
}
virtual QString getString() const {
return s;
}
virtual void setInt(int v) {
i = v;
}
virtual void setDouble(int v) {
d = v;
}
virtual void setString(const QString& v) {
s = v;
}
private:
int i;
double d;
QString s;
};
Thanks.