Hey Johannes, 2010/1/28 Johannes Kepler <[email protected]>: > hi koen, > >> I think you will also need to use composition, since WCartesianChart >> is a WPaintedWidget. >> And specialize WCartesianChart to customize its rendering. > > so you think the WVirtualCartesianChart (if the name is appropriate) should > inherit from WCartesianChart and use some WPaintedWidget's for painting the > rendered data and use the functionality from WVirtualImage for scrolling. > sounds tricky, but possible.
No, we should really change WCartesianChart to extend WCompositeWidget, and this would then use a number of WPaintedWidgets (e.g. AxisWidget, ChartAreaWidget) to do the actual painting. We can still leave the scrolling logic in WVirtualCartesianChart but at least need to refactor WCartesianChart to break down the rendering into the parts that are scrolled seperately. >> (Not by coincidence coming to Fosdem ?) > > oh. i think that's to far from here (austria) but would be nice and > interesting. True. But not that far ! :-) >> Well, WAbstractItemModel does not really hold any data, it's just an >> interface. I would rather then suggest that you have a custom >> implementation of the model that does not need everything in memory ? >> >> We just need to make sure that the chart only attempts to fetch >> relevant data from the model. This is only doable if there is a way to >> calculate X range -> relevant row indexes. I haven't thought about >> this yet, but we could add virtual methods so that a user can specify >> this (in any case it is an optimisation to render less?). The default >> implementation would just return the range (0, model->rowCount()). > > my problem is, that i fetch the data form a database (mysql) which holds up to > 500.000 entries and more. i don't think a model can handle this. > or can DBO help here? You can implement a WAbstractItemModel which does a count(*) (and caches it) for implementing rowCount(), and fetches data in batches (caching it) to implement data(). We are planning to create a dbo example that does exactly this, but we have done the same in JWt using Hibernate already, and this works very well. Regards, koen ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
