开发者

toStdString/toStdWString bug?

开发者 https://www.devze.com 2023-01-29 05:21 出处:网络
i used like this: (vs2010 + qt4.7) std::wstring test2 = L\"\"; QString test =tr(\"test\"); test2 = test.toStdWString();

i used like this: (vs2010 + qt4.7)

std::wstring test2 = L""; 
QString test =tr("test");
test2 = test.toStdWString();

debug and found test2:

귢bĀ

anyone can help me?

Now i make it working like this:

std::wstring test2 = L""; 
QString test =tr("test");
test2.resize(test.length());test2.resize(tes开发者_开发问答t.toWCharArray(&(*test2.begin())));

i copy that from the toStdWString


I suggest moving old QT binaries to a different directory to make sure your program isn't linking against them eg. Old4.7.1.

0

精彩评论

暂无评论...
验证码 换一张
取 消