PDA

View Full Version : QTableView: scrollTo() not work



jasonhxs
20th November 2014, 09:54
Hi,
I used the QSortFilterProxyModel as its model, and found in my TableView, the scrollTo() can't work.
I checked the QT document, it said we can call scrollTo() two times to force scrolling, but it doesn't work.
Do you have any idea, thanks.

wysota
20th November 2014, 09:56
You have to pass the index from QSortFilterProxyModel to scrollTo() and not from your base model.

jasonhxs
21st November 2014, 06:02
Hi,

Yes, I did use the index of QSortFilterProxyModel(), but can't work.

wysota
21st November 2014, 06:24
How does "can't work" manifest itself?

jasonhxs
2nd December 2014, 09:18
Hi,

I know the root cause. It is because I set the cell hidden, so scrollTo() failed.
Thanks.