Hi
In this code i have to write all the items of a QStringList into a text file:
Qt Code:
  1. QString fileName = QFileDialog::getSaveFileName(this);
  2. if (fileName.isEmpty()){
  3. //
  4. }else{
  5. QFile file(fileName);
  6. if (!file.open(QFile::WriteOnly | QFile::Text)) {
  7. QMessageBox::warning(this, tr("Application"),
  8. tr("Cannot write file %1:\n%2.")
  9. .arg(fileName)
  10. .arg(file.errorString()));
  11. }else{
  12. QTextStream out(&file);
  13. //here
  14. out << "i want to write the content of the QStringList x here";
  15. file.close();
  16. }
  17. }
To copy to clipboard, switch view to plain text mode 

I read about using QVariant for this purpose!
Is this the right approach?
Can someone provide me with an example?

Thanks