PDA

View Full Version : Qt with vertical scroll



psarangi
9th December 2013, 13:38
hello,

I am new to QT and trying my hand in tableview. I have huge data but want to show 1-10 in a table and want to use scroll bar when items will get added up. My question is .. is there any way that i can get to know that from which index to which index i am currently seeing in my table.
Basically I want to know how do i make a view of my table dynamic to fetch and display dynamic data.

Kindly suggest me ..


Thanks ... :)

anda_skoa
9th December 2013, 14:38
The easiest way if if you know the amount of items before hand.
In this case you can just implement a table model and let rowCount() return that number. Qt's table view will only retrieve that it needs for displaying.

Cheers,
_

psarangi
11th December 2013, 09:12
Thank you !!! :)

It means that we have to maintain a table internally, which will keep the mapping between a view and the data.

Thanks... :)

anda_skoa
11th December 2013, 10:33
Depending on your data it might be possible to further optimize this using canFetchMore() and fetchMore(), but of course also more complex.

Cheers,
_