Hi,

I am using a QTableView to display a table containing 3949 lines and 12 columns.

It's very long (>1 min).

I am using my own model named SKGObjectModel (derived from SKGObjectModelBase (derived from QAbstractItemModel)).

Here is a part of my analysis:
Qt Code:
  1. ##methode nb call time in this method average %
  2. ##SKGObjectModel::data 2682080 32612,7 0,01 38,43%
  3. ##SKGObjectModelBase::rowCount 2683753 12215,9 0 14,39%
  4. ##SKGObjectModelBase::index 2683717 11362,9 0 13,39%
  5. ##QAbstractItemModel::reset 11 10761 978,27 12,68%
  6. ##SKGObjectModelBase::data 2323211 9616,11 0 11,33%
  7. ##SKGObjectModelBase::headerData 244223 3669,73 0,02 4,32%
  8. ##SKGServices::executeSelectSqliteOrder(QSqlDatabase) 114 1544,71 13,55 1,82%
  9. ##SKGServices::executeSqliteOrder(QSqlDatabase) 287 1207,02 4,21 1,42%
  10. ##SKGMainPanel::SKGMainPanel 1 559,59 559,59 0,66%
  11. ##SKGMainPanel::setNewTabContent 1 429,53 429,53 0,51%
  12. ##SKGObjectBase::getObjects 37 383,36 10,36 0,45%
To copy to clipboard, switch view to plain text mode 

As you can see, data rowCount and index are very performant (average ~ 0) but I have bad performances because of these methods are called to many times (~ 2 600 000 times).

Do you know why ?
What can I do to avoid this ?

In advance, thank you for your help.

PS: the code is there: http://skrooge.svn.sourceforge.net/viewvc/skrooge/