Qasim
Qasim

Reputation: 83

how to can insert the value from txt file to the Qlist and work with QTablewideget

how i can to insert the value from txt file in to the Qlist...

    QList<QString> list_StRead;
    list_StRead.insert();

i can sorting txt file ... its mean that my file is a line by line... than after the insert to the Qlist i want to write in to Qtabelewidget... how i must to do?? u must to be completely understand.. see the img file .. enter image description here

tnx for all....

Upvotes: 0

Views: 229

Answers (1)

user5821508
user5821508

Reputation: 332

#include <QStringList>
#include <QFile>
#include <QTextStream>

int main(void)
{
  QFile data("data.txt");
  QTextStream stream(&data);
  QStringList strings(stream.readAll().split("\n")); // or another split character
}

Upvotes: 2

Related Questions