1 bool VerifyNumber(QString str) 2 { 3 std::string temp = str.toStdString(); 4 for (int i = 0; i < str.length(); i++) 5 { 6 if (temp[i]<'0' || temp[i]>'9') 7 { 8 return false; 9 } 10 } 11 12 return true; 13 }