代码如下: QString processString(const QString& str) { bool isNumber; int number = str.toInt(&isNumber); if (isNumber) {