Jason H <scorp1us@...> writes: > > > If this is your first time writing models, it is extraordinarily complex and stunningly simple at the same time. They are over engineered, but they work really well. Once you get the hand of it, you'll be using models for everything. They are very powerful. With a data model, you an chain it to a sort and filter models, and wham it hits you the power at your fingers! > > > > > From: Nagaev Boris <bnag...@gmail.com>To: witty-interest <witty-interest@lists.sourceforge.net> Sent: Wednesday, September 25, 2013 4:27 PMSubject: Re: > [Wt-interest] WTreeView - unable to browse very large datasets > Hi, Nigel,WStandardItemModel is stored in memory, so it is not suitable forlarge data sets. You should implement WAbstractItemModel for yourdata. Main method to implement is data(). To get information onposition of current cell in tree, use WModelIndex.parent() andargument ``parent'' of data().To add/remove data, use the following rule:1. call beginInsertRows/beginRemoveRows2. change internal data of the model3. call endInsertRows/endRemoveRowsModel will emit all signals needed to properly update View widgets.Table/tree models/views are implemented in Wt in the same way as inQt. So, you can see Qt examples (for example,http://qt-project.org/doc/qt-4.8/itemviews-simpletreemodel.html),replacing Q with W.С уважением,Нагаев БорисOn Wed, Sep 25, 2013 at 5:23 PM, Nigel Lea <nigel...@softspanner.com> wrote:> Hi>> I'm fairly new to Wt, currently using 3.3.1 in Ubuntu>> I'm trying to create a WTreeView browser for a large existing database. The> data has an inherent tree structure of 4 levels with over 300000 items at> the top level and over 10 million at the lowest level.>> I can display a subset of the data by populating the WStandardItemModel of> the WtreeView, this looks good and behaves well but I can't find how to> extend this to the full dataset.>> Obviously I can't load all of the data at once so I was hoping to > start with> a subset (say a 100 top level items + child data) and then respond to> signals representing scrolling/paging. Here I would add new data (at> beginning or end) and remove data out of scope.>> My problem is that I can't discover which signal I should use, None of the> signals available in WTreeView, WStandardItemModel or WAbstractItemModel> seem to be suitable.>> Possibly my strategy is incorrect, any help would be welcome.>> Regards>> Nigel>>> ----------------------------------------------------------------------------
I think that I now have a clear idea of how to proceed. Many thanks for your suggestions and comments (Boris and Jason) Regards Nigel ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk _______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest