Sorry for the wrong use coder777, I mean I take "expression cannot be evaluated" error in runtime when I want to access those members in the code above.
I don't understand your error. You say you get it at runtime?
I don't know if it's relevant but Contact::Contact(parent); creates a temporary Contact object that will only exist on that line (2).
Can std::string be implicit converted to a QString? Maybe you have to write return QString::fromStdString(_gmailDisplayName); I have never used Qt so I don't really know.
Can you give us a copy paste of where the error is being stated?
You are leaving code out that might be relevant, this wont compile, there is no closing bracket, nothing is returned... so since this isn't the 'real' code I cant determine what expression it is talking about...
As coder777 has pointed out, you are returning a temporary QString and then returning a reference to this temporary (which will be destroyed before you even use it), granted this isn't your stated problem but this is a problem.