PDA

View Full Version : Example of QAbstractItemModel implementation using QtSQL (to use with QTreeView)



Seba
22nd September 2011, 12:23
Hello everybody,

I'm looking for an example implementation of QAbstractItemModel to use with QTreeView. The model should load datafrom QSqlQuery and should do it in a "lazy" way. In other words I only want to load records for nodes/parents that are open. And I'd like to see how to properly add and remove records from this model.

I tried to implement such model on my own but got a lot of different bugs Especialy when I started adding and removing rows.

If you know where I could find such example I would be very grateful.

Thanks :)