#includeint main() { QStringList myList; myList.append("apple"); myList.append("banana"); myList.append("cherry"); return 0; }
#includeThis example shows how to use the QList template class to create a list of strings. The append method is used to add three strings to the list. The resulting list will contain the strings "dog", "cat", and "hamster". The StringList and QList classes are part of the Qt library, which is a package of C++ classes for developing cross-platform applications.int main() { QList myList; myList.append("dog"); myList.append("cat"); myList.append("hamster"); return 0; }