标签:c_str path rds pat copy 字符 html qstring str
QFileInfo info("./records.db"); std::string str = info.absoluteFilePath().toStdString(); //将QString转换为string std::wstring wstr(str.length(), L‘ ‘); //初始化宽字节wstr std::copy(str.begin(), str.end(), wstr.begin()); //将str复制到wstr LPCWSTR path = wstr.c_str(); //将wstr转换为C字符串的指针,然后赋值给path
转换过程:QString->string->wstring->LPCWSTR
http://www.cnblogs.com/luoxiang/p/5456173.html
QString->string->wstring->LPCWSTR
标签:c_str path rds pat copy 字符 html qstring str
原文地址:http://www.cnblogs.com/findumars/p/5998411.html