I have filenames that have space in them, but are separated by tabs. How can I read them one by one using a QTextStream
?
The normal way would split by tabs AND spaces (actually any QChar::isSpace()
), which is not what I want here:
QString s = "file 1.txt\tfile 2.txt";
QTextStream st(&s);
st >> s1 >> s2; // <--- This won't work, it'll give me "file" and "1.txt"
Right now I'm using QString::split()
instead of QTextStream
as a workaround, but I'd rather use a QTextStream
.