Hi,

I'm having problems with QTextStream

Qt Code:
  1. bool b1 = m_qFile.isOpen(); //returns true
  2. m_qStream.setDevice(&m_qFile); //QTextStream
  3. m_qStream2.setDevice(&m_qFile); //QDataStream
  4.  
  5. QStringList qList = m_qText.split(QString(" "));
  6. QString qText;
  7. for (int i=0; i<qList .count(); i++)
  8. {
  9. qText= qList.at(i);
  10. m_qStream << qText; //It don't write anything
  11. m_qStream2 << qText; //It writes the QString
  12. }
  13. m_qFile.flush();
  14. m_qFile.close();
To copy to clipboard, switch view to plain text mode 

If I use QTextStrem, it don't write anything to the file but using QDataStream it writes the QString data into the file. I don't understand what it's happening.

Thanks,