QFile file("my.txt");
file.open(QIODevice::ReadOnly);
QTextStream in(&file);
while (true) {
QString line = in.readLine();
if (line.isNull())
break;
QStringList parts = line.split(",");
//parts为逗号分隔的数据
//处理数据
}
file.close();