I have a QDialog which has a QLineEdit and a slot connected to the QLineEdit's textChanged signal.
std::string gname;
void NewMsgDialog::nameChanged(QString str) {
auto temp = str.toUtf8().constData();
gname = str.toStdString();
}
In the debugger I can see that temp has a sensible content (e. g. "my text") but at the end of the function, gname's value says "<not accessible>". And really, if I use gname from another function, I get a SEGFAULT.
What could be wrong?