Appending number to QString with arg() , is there better ways?
问题 I've been using QString::number () to convert numbers to string for long time , now i'm wondering if there's something better than following: int i = 0; QString msg = QString ("Loading %1").arg (QString::number (i)); How can i spare QString::number () ? i checked document , seems only "%1" is applicable , no other stuff like "%d" could work 回答1: You can directly use arg() like this int i = 0; QString msg = QString ("Loading %1").arg(i); Qt will automatically convert it for you 回答2: QString's