jeudi 28 août 2014

Qt model alternative


Vote count:

0




I’m old Delphi/FreePascal/Lazarus programmer. I’m programming in Qt and C++ from a year. The most painfull for me in Qt is model programming. Especially efficient. For example filling QStandardItemModel with 1 million records take ~15 seconds, 700MB memory usage and QTreeView scrolling is almost impossible (100% CPU, seems that each scroll validate even not visible items). For comparison, in Lazarus I have TVirtualTreeView where I override one virtual method OnGetData. In arguments I get row and column index and returning data from TList (something like QList) or from dynamic array. Result: filling 1 million records = 150 ms, +20MB in RAM, fully responsible scrolling (OnGetData is called only for visible items). I tried also with QAbstractItemModel, a lot of coding and I only reduced memory usage (not so much).


My question: Is there any alternative for model programming? Few months ago I saw tutorial for custom dataset in QTreeView but can’t find it now. They used simple QList and override few methods in QTreeView.


Regards



asked 1 min ago

Dibo

398






Qt model alternative

Aucun commentaire:

Enregistrer un commentaire