void FileCopier::showProgress(int done, int total, const QString ¤tFile){
label.setText(tr("%1 of %2 files copied./nCopying: %3").arg(done).arg(total).arg(currentFile));}
参数顺序:
QString s1 ="%1 of %2 files copied. Copying: %3";
QString s2 ="Kopierer nu %3. Av totalt %2 filer er %1 kopiert.";
qDebug()<< s1.arg(5).arg(10).arg("somefile.txt");
qDebug()<< s2.arg(5).arg(10).arg("somefile.txt");
输出:
5 of 10 files copied. Copying: somefile.txt
Kopierer nu somefile.txt. Av totalt 10 filer er 5 kopiert.