Qt: QAbstractItemModel and 'const'
- by Eye of Hell
Hello.
I'm trying to use a QTreeView for a first time, with a QAbstractItemModel. And instantly it's a problem: QAbstractItemModel interface declares methods as 'const', assuming they will not change data. But i want a result of SQL query displayed, and returning data for a record with specified indeq REQUIRES to use QSqlQuery::seek() that is a non-const. Is it any 'official' guideline to use a QAbstractItemModel with data that MUST be changed in order to get number of items, data per item etc? Or i must hack C++ with const casts?