- XML code
<item name="IDS_CAPACITY_CONTENT"><font style='color:#202020;font-size:10px;'>%d</font><br/><font style='color:#757575;font-size:10px;'>dof %d</font</item>
其中的两个%d,想用
QString strContentFormat;
strContentFormat.sprintf(strContent.toStdString().c_str(), m_iCapacity, m_iNum);
将其格式化进去,结果失败了。
有什么好的方法,将两个int数,格式化到那两个%d的位置上?
------解决方案--------------------
QString str=tr("%1%2").arg(m_iCapacity).arg(m_iNum)