trying to figure out the filter code

Dirk Hohndel dirk at hohndel.org
Mon Nov 3 16:21:50 PST 2014


So I'm trying to understand how this all hooks together and it's clear
that there's some Qt magic in the background that I'm missing...

Let's assume I want to have a function called every time the filters
change. How would I go about this?

Another question. In the regular model code for the dive list - we have
lots of selection modification code there. That needs to become aware of
filter data so that selecting a trip in the filtered view only selects the
dives inside this trip that are visible under the filter - and similarly,
the trip row in the view needs to show the number of visible dives in that
trip, not the number of total dives in that trip.

To illustrate:

I have a trip with 12 dives

I filter for dives with Buddy Tomaz

Then only the 6 dives with Tomaz are shown, but similarly the trip summary
row should read

Dive trip (6 dives)

instead of "(12 dives)"

So when I'm in TripItem::data() member, how can I figure out how many of
the dives in that trip are visible with the current filter?

I'm not asking you to implement any or all of this - I'm hoping that
you'll be able to teach me enough to understand how all this works so I
can implement it myself.

/D


More information about the subsurface mailing list