I'm using GCC7 on Qt 5.9.4 on openSUSE Leap 15.
I have the following class:
class ManSuppProps : public QObject
{
Q_OBJECT
public:
explicit ManSuppProps(QString parentName);
explicit ManSuppProps(){}
explicit ManSuppProps(const ManSuppProps &manSuppProps);
explicit ManSuppProps(ManSuppProps &manSuppProps);
~ManSuppProps();
private:
QVector3D m_suppPos;
QString m_suppParentName;
}
With the following implementations for constructors:
ManSuppProps::ManSuppProps(QString parentName)
: QObject()
, m_suppPos(QVector3D(0, 0, 0))
, m_suppParentName(parentName)
{
qDebug()<<"Constructing ManSuppProps object ...";
}
ManSuppProps::ManSuppProps(const ManSuppProps &manSuppProps)
: QObject()
, m_suppPos(manSuppProps.getSuppPos())
, m_suppParentName(manSuppProps.getSuppParentName())
{
}
ManSuppProps::ManSuppProps(ManSuppProps &manSuppProps)
: QObject()
, m_suppPos(manSuppProps.getSuppPos())
, m_suppParentName(manSuppProps.getSuppParentName())
{
}
ManSuppProps::~ManSuppProps(){}
I'm receiving the following error:
error: no matching function for call to ‘ManSuppProps::ManSuppProps(ManSuppProps&)’
At a method of another class which has a member of class ManSuppProps:
ManSuppProps EditorScene::manSuppProps()
{
return m_manSuppProps; // error is thrown here
}
Considering I have all the constructors, I don't get why the error is received. Can anybody help.