[Aptitude-devel] Experimental package and package_pool implementation

Sune Vuorela nospam at vuorela.dk
Wed Jul 14 22:19:29 UTC 2010


On 2010-07-14, Daniel Burrows <dburrows at google.com> wrote:
> On Wed, Jul 14, 2010 at 12:31 PM, Piotr Galiszewski
><piotr at galiszewski.pl> wrote:
>> 2010/7/14 Daniel Burrows <dburrows at google.com>:
>>>  So, let me ask my main question more directly: suppose I have
>>> two different package tabs with different filters.  How do they end
>>> up displaying different lists of packages, if they both just show all
>>> the packages in the singleton package_pool?
>>>
>>
>> It is the power of Qt models ;) Model is only asked about what should
>> be displayed. Sorting and filtering is done by proxy model, which
>> decides is one particular package should be displayed or not. So model
>> always contains reference to all objects in view (is not entirely true
>> because data could lazy loaded), and by default all packages are
>> displayed. But each view will have different proxy model. And every
>> proxy model decides which item will be displayed. My sample code from
>> later patch:
>
>   Ah, ok.  So this is a model, but it's not the model that the view sees;
> indices into the pool are stored in the proxy models, which are what
> is actually displayed.  That makes sense.

There was a couple of great talks (now with videos) from akademy about
model view stuff

http://akademy2010.kde.org/program/conference#saturday
at 17:45  I can see your house from here 

More generic and historic approach to qt model view

at 18:15  Interview Test: Testing the model view implementation in your
application

testing models

/Sune




More information about the Aptitude-devel mailing list