QStringList fruits; fruits << "orange" << "banana" << "apple"; fruits.push_front("pear"); // fruits now contains ["pear", "orange", "banana", "apple"]
QStringList names; names.push_front("Alice"); names.push_front("Bob"); names.push_front("Charlie"); // names now contains ["Charlie", "Bob", "Alice"]In this example, we create an empty `QStringList` and use `push_front` to insert three names at the beginning of the list. Package library: Qt Framework