有两种方法:
1.
QString
::
number
int a = 63;
QString s10 = QString::number(a, 10); //s == '63'
QString s16 = QString::number(a, 16).toUpper(); //s == '3F'
2. QString::arg
int rowCount = 0;
QString s2 = QString("rowCount: %1. we need %2 rows more").arg(rowCount).arg(iSample); //"rowCount: 0. we need 63 rows more"
注意:%后面是数字1,2,3……,不是%d, %l等