hi!

i have a couple of template classes and let them inherit from QObject to use the signal/slot observer pattern. at compile-time though i get a whole lot of linker errors. is it possible to use qt's signal/slot mechanism in template classes? if not, are there alternatives?
i'll give some samples out of my code and one of the linker errors to make things a bit clearer:

Qt Code:
  1. template <class T>
  2. class ColladaReference :
  3. public QObject
  4. {
  5. Q_OBJECT
  6. public:
  7. ColladaReference(){};
  8. ColladaReference(T *ref){reference = ref;}
  9. ~ColladaReference(){};
  10.  
  11. void deleteReference();
  12.  
  13. private:
  14. T *reference;
  15. };
  16. ==========
  17. template <class T>
  18. class ColladaRepresentation :
  19. public QObject
  20. {
  21. Q_OBJECT
  22. public:
  23. ColladaRepresentation(){representation = NULL;} // constructor
  24. ColladaRepresentation(T *rep){representation = rep;} // constructor with collada ptr
  25.  
  26. void setRepresentation(T *rep){representation = rep;}
  27. public slots:
  28. void deleteRepresentation();
  29. signals:
  30. void representationDeleted(){};
  31. private:
  32. T * representation;
  33. };
  34. ====================
  35. typedef ColladaRepresentation<domGeometry> GeometryRepresentation;
  36. typedef ColladaReference<domInstance_geometry> GeometryReference;
  37. ====================
  38. GeometryReference *geometryReference = new GeometryReference(instanceGeometry);
  39. GeometryRepresentation *geometryRepresentation = new GeometryRepresentation(geometryNode[k]);
  40. connect(geometryRepresentation, SIGNAL(representationDeleted()), geometryReference, SLOT(deleteReference()));
  41. =================
To copy to clipboard, switch view to plain text mode 
Error 3 error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall ColladaReference<class domInstance_geometry>::metaObject(void)const " (?metaObject@?$ColladaReference@VdomInstance_geome try@@@@UBEPBUQMetaObject@@XZ) colladaLoader.obj