PDA

View Full Version : QTableView and auto scroll



ranna
23rd March 2009, 14:02
Hi,

i have a TableView of 50 rows and 50 cols. When there is a dataChanged signal i will call a slot and set the current index of table view to row 0 col 1.

OnDataChanged(QModelIndex index)
{
...
....
QModel index = tableView->index(0,1)l
tableView->setCurrentIndex(index);
..
}

I have scrolled down to certain index, for example, row 25 and col 25, and i have changed the data. Once done, the scroll bar is automatically moved up. It may be due to the functin call tableView->setCurrentIndex(index) in the above function. I dont want to do the auto scroll after changing data in certain location.

I have tried with disabling autoscroll by tableView->setAutoScroll(false); But the problem still occurs.

If any body have an idea, please let me know the same.

ranna