QString s("hello"); printf("s=%s\n", s.toUtf8().data()); printf("s=%s\n", s.toStdString().c_str());More info https://doc.qt.io/qt-5/qstring.html
Programming Tips - QT: QString to char *
Date: 2020jul25
Language: C/C++
Framework: QT
Q. QT: QString to char *
A. Here are two ways: