//QString fileName = QFileDialog::getOpenFileName(this, ("Open File"), NULL, ("Language(*.csv)"));
fileName = "English.csv"; //<<<<<<<<<<<<<<<<<
QFile importedCSV
(fileName
);
data.clear();
rowOfData.clear();
rowData.clear();
if (importedCSV.
open(QFile::ReadOnly)) {
data = importedCSV.readAll();
rowOfData = data.split("\n"); //Value on each row
importedCSV.close();
}
for (int x = 0; x < rowOfData.size(); x++) //rowOfData.size() gives the number of row
{
rowData = rowOfData.at(x).split(";"); //Number of columns
// int r=rowData.size();
for (int y = 0; y < rowData.size(); y++)
{
mUI.languageTable->item(x,y)->setText(rowData[y]);
}
}
//QString fileName = QFileDialog::getOpenFileName(this, ("Open File"), NULL, ("Language(*.csv)"));
fileName = "English.csv"; //<<<<<<<<<<<<<<<<<
QString data;
QFile importedCSV(fileName);
QStringList rowOfData;
QStringList rowData;
data.clear();
rowOfData.clear();
rowData.clear();
if (importedCSV.open(QFile::ReadOnly))
{
data = importedCSV.readAll();
rowOfData = data.split("\n"); //Value on each row
importedCSV.close();
}
for (int x = 0; x < rowOfData.size(); x++) //rowOfData.size() gives the number of row
{
rowData = rowOfData.at(x).split(";"); //Number of columns
// int r=rowData.size();
for (int y = 0; y < rowData.size(); y++)
{
mUI.languageTable->item(x,y)->setText(rowData[y]);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks