Hi
That's true, but when I tried doing that I am getting an error.
Cannot convert from QStandardItemModel ** to QAbstractItemModel*.
Change:
QStandardItemModel model=new QStandardItemModel(10,3, this);
Thanks
Added after 4 minutes:
Correction
QStandardItemModel *model=new QStandardItemModel(10,3,this);
If I do the following; The exe stops working giving an error
if(file.open(QIODevice::ReadOnly)){
QString line;
QStringList line_data;
while(!file.atEnd()){
line=file.readLine();
line_data=line.split(";", QString::SkipEmptyParts);
for(int j=0;j<line_data.size();j++){
QString m_prop=line_data.at(j);
QTableWidgetItem *item=new QTableWidgetItem(m_prop);
ui->tableWidget->setItem(line_count,j,item);
}
line_count++;
}
}
Added after 1 14 minutes:
why do I need to create 3 different data structures just to simply acces strings from a file, parse them and display them onto a Table?
I am unfortunately still unable to find a solution to this.
Bookmarks