[Qt-interest] Fwd: dynamic properties
ami guru
dosto.walla at gmail.com
Fri Feb 6 11:43:13 CET 2009
Hello forum,
I am not sure if i have elaborated enough about the issue posted last time.
If not then please ask me so that i can explain more and get suggestion on
that as i am currently stuck with that.
Regards
Sajjad
---------- Forwarded message ----------
From: ami guru <dosto.walla at gmail.com>
Date: Thu, Feb 5, 2009 at 4:01 PM
Subject: dynamic properties
To: qt-interest at trolltech.com
Hello forum,
"Dynamic properties are specific to an object. In other words, two objects
of the same class can have a different list of dynamic properties. All
objects of the same class share the same metaObject and thus, the same
static properties."
"It is possible to store/load properties on a QObject without having them
explicitly defined."
The property name and value may not be necessary to be explicitly defined.
But what about their corresponding type.
Isnt that necessary for the type to be defined as well. If it is then is
that in the following way:
**********************************''
class SFVec3f
{
public:
SFVec3f()
: x(0.0f),y(0.0f),z(0.0f)
{
}
SFVec3f(float _x,float _y,float _z)
: x(_x),y(_y),z(_z)
{
}
SFVec3f(const SFVec3f &_vec)
{
this->x = _vec.x;
this->y = _vec.y;
this->z = _vec.z;
}
bool operator ==(const SFVec3f &other) const
{
return x == other.x && y == other.y && z == other.z;
}
bool operator !=(const SFVec3f &other) const
{
return x != other.x || y != other.y || z != other.z;
}
float x,y,z;
};
Q_DECLARE_METATYPE(SFVec3f)
*************************************
Regards
Sajjad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090206/f600cabd/attachment.html
More information about the Qt-interest-old
mailing list