QString与string类型互相转换

</pre><pre name="code" class="html"><strong>/*string转QString*/</strong>
<strong>QString qstrTemp;
qstrTemp = QString::fromStdString(strSlice); /*string转QString*/</strong>
<strong>
</strong>
<strong><span style="font-family: Arial, Helvetica, sans-serif;">/*QString转string*</span></strong>
<strong>strSlice = <span style="font-family: Arial, Helvetica, sans-serif;">qstrTemp</span><span style="font-family: Arial, Helvetica, sans-serif;">.toStdString();   </span></strong>

你可能感兴趣的:(QString与string类型互相转换)