Hello anyone,

I have Qt-4.2.3 on Windows XP
The problem is QStringList
I want to read a line with string items in QStringList through a Dialog .
I did this with QtSql and it works fine but i don't want to use QtSql.
I want to use a file.

mainwindow.cpp
Qt Code:
  1. oid MainWindow::zoek()
  2. {
  3. zoekDialog dlg(this);
  4. if( dlg.exec() == QDialog::Accepted ) {
  5.  
  6. QString treksterkte, koeling, snijsnelheid, voedingpertand, snedediepte, snedebreedte,
  7.  
  8. QString materiaal = dlg.matComboBox->currentText();
  9. QString freestype = dlg.freesComboBox->currentText();
  10. QString diameter = dlg.diaComboBox->currentText();
  11. QString tand = dlg.tandComboBox->currentText();
  12. QString bewerking = dlg.bewerkComboBox->currentText();
  13.  
  14. QFile file("C:/Qt/Qt-prog/richtwaarden/frees.txt");
  15. if( !file.open(QFile::ReadOnly))
  16. return;
  17.  
  18. QTextStream stream( &file);
  19. QString line;
  20. do {
  21.  
  22. line = stream.readLine();
  23. if(!line.isEmpty())
  24. {
  25. QStringList frees = line.split('\t', QString::SkipEmptyParts);
  26. QStringList::iterator it = frees.begin();
  27. if(it != frees.end())
  28. {
  29. if ( *it == materiaal )
  30. leMateriaal->setText(*it); //put the text in the linedit.
  31. ++it;
  32. }
  33. }
  34. }while(!line.isEmpty());
  35.  
  36.  
  37. file.close();
  38. }
To copy to clipboard, switch view to plain text mode 
This works but he only find one string materiaal.
I want to find all the string items wich i choose in the comboboxes in the zoekdialog.

Thanks in advance