Refactored code to use QStringList CommandBlock (takeFirst and join) to parse the commandStr instead of relying on a regex.