jano_alex_es
15th May 2009, 07:56
Hi,
I need to go through a TableView, obtain some data... and since now I did something like:
QAbstractItemModel* tableModel;
QModelIndex index;
tableModel = my_TableView->model();
index = my_TableView->currentIndex();
for(int i = 0; i < tableModel->rowCount(); ++i)
{
iIDList->append(tableModel->data(index.sibling(i, 4)).toInt());
}
tableModel = 0;
But now I don't have any index selected... so "currentIndex()" sends null.
Any idea how I can solve it? thanks!
I need to go through a TableView, obtain some data... and since now I did something like:
QAbstractItemModel* tableModel;
QModelIndex index;
tableModel = my_TableView->model();
index = my_TableView->currentIndex();
for(int i = 0; i < tableModel->rowCount(); ++i)
{
iIDList->append(tableModel->data(index.sibling(i, 4)).toInt());
}
tableModel = 0;
But now I don't have any index selected... so "currentIndex()" sends null.
Any idea how I can solve it? thanks!