Ok. I have a class.

Qt Code:
  1. class Material : public QObject
  2. {
  3. public:
  4. Material(QObject *parent = 0);
  5.  
  6. protected:
  7. int m_count;
  8. QString m_fisName;
  9. QString m_fisCode;
  10. QString m_name;
  11. QString m_nameAux;
  12. };
To copy to clipboard, switch view to plain text mode 

I made a typedef

Qt Code:
  1. typedef QList<Material> MaterialList;
To copy to clipboard, switch view to plain text mode 

I have another class

Qt Code:
  1. class RegularOrder : public Order
  2. {
  3. public:
  4. RegularOrder(QObject *parent = 0);
  5.  
  6. void TwinList(MaterialList twinList);
  7. void P3110List(MaterialList p3110List);
  8. void CPSList(MaterialList cpsList);
  9. void KernList(MaterialList kernList);
  10. void BurhList(MaterialList burhList);
  11. void ManualList(MaterialList manualList);
  12.  
  13. protected:
  14. QList<Template> m_templateList;
  15. int m_currentTemplateIndex;
  16.  
  17. UseFlag m_listFlag;
  18. int m_listCount;
  19. QString m_deliveryWhole;
  20.  
  21. MaterialList m_twinList;
  22. MaterialList m_p3110List;
  23. MaterialList m_cpsList;
  24. MaterialList m_kernList;
  25. MaterialList m_burhList;
  26. MaterialList m_manualList;
  27.  
  28. QList<JobProperties> m_jobPropertiesList;
  29. };
To copy to clipboard, switch view to plain text mode 

which is so far implemented like this

Qt Code:
  1. RegularOrder::RegularOrder(QObject *parent) : Order(parent)
  2. {
  3. }
  4.  
  5. void RegularOrder::TwinList(MaterialList twinList)
  6. {
  7. m_twinList = twinList;
  8. }
  9.  
  10. void RegularOrder::P3110List(MaterialList p3110List)
  11. {
  12. m_p3110List = p3110List;
  13. }
  14.  
  15. void RegularOrder::CPSList(MaterialList cpsList)
  16. {
  17. m_cpsList = cpsList;
  18. }
  19.  
  20. void RegularOrder::KernList(MaterialList kernList)
  21. {
  22. m_kernList = kernList;
  23. }
  24.  
  25. void RegularOrder::BurhList(MaterialList burhList)
  26. {
  27. m_burhList = burhList;
  28. }
  29.  
  30. void RegularOrder::ManualList(MaterialList manualList)
  31. {
  32. m_manualList = manualList;
  33. }
To copy to clipboard, switch view to plain text mode 

When I try to compile I get the following messages:

/home/ivan/Development/Qt/Radni Nalog/WorkOrder/woidl.cpp:1: In file included from woidl.cpp:1:
/home/ivan/Development/Qt/Radni Nalog/WorkOrder/woidl.h:14: instantiated from ‘void QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with T = Telekom::WorkOrder::Material]’
/home/ivan/Development/Qt/Radni Nalog/WorkOrder/woidl.h:14: instantiated from ‘void QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with T = Telekom::WorkOrder::Material]’
/home/ivan/Development/Qt/Radni Nalog/WorkOrder/woidl.h:14: instantiated from ‘void QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with T = Telekom::WorkOrder::Material]’
/home/ivan/Development/Qt/Radni Nalog/WorkOrder/woidl.h:14: instantiated from ‘void QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with T = Telekom::WorkOrder::Material]’
/home/ivan/Development/Qt/Radni Nalog/WorkOrder/woidl.h:14: instantiated from ‘void QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with T = Telekom::WorkOrder::Material]’

Basically the compile stops at the m_twinList = twinList line of code. I read somewhere that QObject can't be used as a reference and copied as normal because of something but honestly didn't understand it completely.

I solved the problem by removing the inheritance of QObject in Material class. I made it independent. Now I only sort of needed that because I could make some other object a parent of the material class instances so I would have to worry about deleting it. My program will work just fine with out this parenting because only RegularOrder class will be instantiated and only RegularOrder class will need a parent to look after it. But could somebody explain to me what exactly happened here so I know for the future.

Thanks.