Hello,
the error message you get is pretty clear: you need to call method toString() with an object of type Process. Your way of calling toString() can only be used if toString() is a static member function of class Process. So your code of class 2 should look like
QString Items
::toString(const Process
& process
) const {
.arg(process.toString());
return product;
}
QString Items::toString(const Process& process) const
{
QString product = QString("Item process: %1\n")
.arg(process.toString());
return product;
}
To copy to clipboard, switch view to plain text mode
Note that we pass a reference to a Process object to the Items::toString() method and we use this reference for accessing the Process object toString() method.
One more note: your code would also fail compiling at line
return process;
return process;
To copy to clipboard, switch view to plain text mode
Best regards
ars
P.s.: please use code tags in your post.
Bookmarks