Hello friends,
I am using table view to show some data which will be read from a csv file. But i have to access the csv file through a translator as the contents are going to be changed dynamically, so storage, sync and retrieval should be proper. I have a translator implemented, which uses a hash function. My dilemma is how to dynamically set row count and column count. As i viewed the model view documentation, there are 2 functions and the return value of it decides the row count and column count. I am posting the link for the doc and the function name below :-
http://qt-project.org/doc/qt-4.8/modelview.html
int MyModel::rowCount(const QModelIndex & /*parent*/) const
{
return 2;
}
int MyModel::columnCount(const QModelIndex & /*parent*/) const
{
return 3;
}
As one can see above, if it returns 2 rows, then 2 rows are displayed in the model. How can i do this dynamically with a csv file?
Bookmarks