PDA

View Full Version : How to get the itemCount in QTableView



chethana
3rd August 2009, 07:31
Hi All,


I am using QTableView for that i have created custom model which is derived from QStanderdItemModel.

In my application inserting rows are dynamic . i.e . i don't no the exact rows intialy As the data comes from the socket i need to append data to row in the Model.

intially i have created

QStanderItemModel(20,20,parent)

Using rowcount() function i am getting 20 rows.

but how to get the itemcount (rowCount) as the data gets added dynamically??


Thanks

Chethana

caduel
3rd August 2009, 08:23
rowCount() returns the number of rows in the model at that time.

If that is not what you want: can you rephrase your question, please?

numbat
3rd August 2009, 09:58
Are you using fetchMore? If so, you could connect to the rowsInserted signal. If not, rowCount should provide the correct count and if it doesn't your model is broken.