#includeint main(){ QStringList fruits; fruits << "Apple" << "Banana" << "Mango"; int num_fruits = fruits.count(); qDebug() << "Total fruits in list: " << num_fruits; return 0; }
#includeThis code creates a TQStringList named countries and removes the first item from the list. It then prints the updated list using qDebug(). The TQStringList class is part of the Qt Core module.int main(){ QStringList countries = {"India", "USA", "UK", "Germany"}; if (countries.count() > 0){ countries.removeFirst(); qDebug() << countries; } return 0; }