When developing with QT and C++, because the data types of the two are not exactly the same, conversion is required
1. Conversion between QString and int
QString qstr = QString::number(123);
int i = atoi(qstr.toStdString().c_str());
can also be like this: int i = atoi(qstr.ascii());
2、QString与string,即std::string
string s = qstr.toStdString();
QString qstr2 = QString::fromStdString(s);
3. QString and char* conversion
I generally use std::string as a transit.