qt - read a text file to QStringList -


i have text file. need read qstringlist. there no line seperators. mean each line in text file in new line. there anyway can this?

i assume every line should separate string in list. use qtextstream::readline() in cycle , on each step append returned value qstringlist. this:

qstringlist stringlist; qfile textfile; //... (open file reading, etc.) qtextstream textstream(&textfile); while (true) {     qstring line = textstream.readline();     if (line.isnull())         break;     else         stringlist.append(line); } 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -