tr()函数的参数只要是char*类型即可。
QString strTest = "测试";
QByteArray byteArray = strTest.toLatin1();
char * ch = byteArray.data();
this->setWindowTitle(QObject::tr(ch));
tr()函数的参数只要是char*类型即可。
QString strTest = "测试";
QByteArray byteArray = strTest.toLatin1();
char * ch = byteArray.data();
this->setWindowTitle(QObject::tr(ch));