Is there an easy way of doing this? It seems that ui->TextEdit->text().toAscii().constData() returns garbage and on further investigation it seems to return a class that is freed before the method returns, so I have to assign it to a QByteArray first - QByteArray text = ui->TextEdit->text().toAscii()) and then use constData on that, which seems overly complicated for such a simple operation.
Bookmarks