Skip to content

Instantly share code, notes, and snippets.

@yangjiheng
Last active June 28, 2022 05:22
Show Gist options
  • Save yangjiheng/d3313b7caa62b21ff4c04eb82264fcea to your computer and use it in GitHub Desktop.
Save yangjiheng/d3313b7caa62b21ff4c04eb82264fcea to your computer and use it in GitHub Desktop.
Check if a QString is a number
bool isNumber(const QString str)
{
QRegExp re("\\d*");
if (re.exactMatch(str)) {
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment