Im trying to take data stored as a QByteArray called dldata that contains a list of newsgroups split into lines by \r\n and using spaces as a delimiter.

"215 Newsgroups in form "group high low flags"."
"alt.hipcrime.physics.research 0000000105 0000000102 y"
"alt.emircpih.physics.research 0000000050 0000000049 y"
"alt.crimehip.physics.research 0000000069 0000000065 y"
"alt.crimehip.engr.wastewater 0000000070 0000000069 y"
Im trying to split this data out to insert into a QtableWidget but i cant seem to figure it out. the code i have so far that does not work is.

Qt Code:
  1. QList<QByteArray> lines = dldata.split('\r\n');
  2. foreach ( const QByteArray &line, lines)
  3. {
  4. qDebug() << line;
  5. QList<QByteArray> line = line.split(" ");
  6. foreach( const QByteArray &field, line)
  7. {
  8. qDebug() << field;
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 

Could someone point me to where im going wrong.