I'm trying to make a simple display my name dialog box. See the code.
Pessoa *p = new Pessoa("Ronald Araújo", "[email protected]", 23);
QMessageBox msg;
msg.setText(QString::fromUtf8(p->getNome()));
msg.exec();
But the code breaks in the setText () line with the following error:
error: no matching function for call to 'QString :: fromUtf8 (std :: string)' msg.setText (QString :: fromUtf8 (p-> getNome));
Implementation to return the name:
string Pessoa::getNome(){ return this->nome; }
Can someone give me a light?