QString str = ""; if(str.isEmpty()) { qDebug() << "The string is empty"; }
QString str = "Hello World"; if(!str.isEmpty()) { qDebug() << "The string is non-empty"; }In both examples, the QString isEmpty function is used to check whether the string is empty or not. If it returns true, then the string is empty, and if it returns false, then the string is not empty. The package library for the QString isEmpty function is the Qt framework, which is available for download from the Qt website.