Error: no matching constructor for initialization what to do?

There is a class TemplateRequirement, in another class, ReqTGroup a vector whose elements are instances of TemplateRequirement.
When run, displays this error:

/Users/Mac/Qt/5.6/clang_64/lib/QtCore.framework/Headers/qvector.h:631: error: no matching constructor for initialization of 'TemplateRequirement'
T copy(t);
^ ~

As I understand it the problem lies precisely in the creation of the vector elements of which is my class, but how to fix it I can't think of.

Class TemplateRequirement:
class TemplateRequirement


 TemplateRequirement(TemplateRequirement &);

 TemplateRequirement(QString&,QString&, QString&);

 TemplateRequirement& operator=(TemplateRequirement&);

 QString getReq();

 QString getType();

 QString getHead();

 void save(std::ofstream &);

 void read(std::ifstream &);

 setRequirement void(QString&);

 QString head;

 QString requirement;

 QString type;


Class ReqTGroup:

class ReqTGroup


 ReqTGroup (int);

 void save();
 void read();

 int findByHead(QString&);

 void addItrm(QString, QString, QString);

 QVector<templaterequirement> requirements;

July 8th 19 at 16:39
2 answers
July 8th 19 at 16:41
Incorrectly declared the copy constructor and assignment operator:
TemplateRequirement(TemplateRequirement &);
TemplateRequirement& operator=(TemplateRequirement&);

It is necessary so:
TemplateRequirement(TemplateRequirement const &);
TemplateRequirement& operator=(const TemplateRequirement&);

I advise you to replace the settings of type QString and a QString& to , const QString&.
What has changed?) - Sigrid.Mosciski commented on July 8th 19 at 16:44
: refresh the page :) - kenyatta commented on July 8th 19 at 16:47
: Thank you, directly saved a life) - Sigrid.Mosciski commented on July 8th 19 at 16:50
July 8th 19 at 16:43
Perhaps in the copy constructor lost const.
TemplateRequirement(TemplateRequirement const &);

Find more questions by tags QtC++