[Qt-interest] register custom type

ami guru dosto.walla at gmail.com
Fri Jan 23 10:43:11 CET 2009


Hello forum,


I have registered a custom type in the following way:


******************************************

struct SFVec3f
{
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)



*****************************************'


Now i need to register another type which is acyually array of SFVec3f

I was wondering if it is correct to do  that in the following way:


****************************************

struct MFVec3f
{
  MFVec3f()
  {

  }


  MFVec3f(const MFVec3f &_vec)
  {

  }

  QVector<SFVec3f> sfvec3fArray;
};


Q_DECLARE_METATYPE(MFVec3f)


***************************************




Regards
Sajjad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090123/22cca669/attachment.html 


More information about the Qt-interest-old mailing list