// Create a QStringList with some strings QStringList list; list << "apple" << "banana" << "cherry" << "apple"; // Remove the first occurrence of "apple" list.removeOne("apple"); // The resulting list should have only one "apple" left qDebug() << list; // Output: ("banana", "cherry", "apple")Package/library: Qt Core library.