std::stringtoStdString( QStringView view ){returnQString(view).toStdString(); } Run Code Online (Sandbox Code Playgroud) 理论上,有 1 个中间内存副本也可以删除;您可以直接从 UTF16 QStringView 数据转换为std::string. std::stringtoStdString( QStringView view ){autotoUtf8 = QStringEncoder(...