[PyKDE] PyQT 4.x Display Roles

Andreas Pakulat apaku at gmx.de
Wed Oct 11 21:54:35 BST 2006


On 11.10.06 13:10:34, Matt Chambers wrote:
> Andreas Pakulat wrote:
> >On 10.10.06 21:19:59, M.Chambers wrote:
> >  
> >>How can I disable some that I'm not using?  Seems like a waste to call
> >>data() that many times.  I'm using the model view stuff and its very
> >>slow compared to Qt3.
> >>    
> >
> >You can't or at least you can't with the built-in Q*Views. You'd have to
> >write your own view class that only asks for the roles you need.
> >
> >Also for speeding things up, try to check the role parameter as one of
> >the first things and return an empty QVariant() if it is uninteresting.
> >
> >If that's still to slow get a profiling tool and check where the time is
> >really spend.
> >
> >Andreas
> >
> >  
> I ended up making a single QVariant and return that over and over again, helped 
> to speed it up:

I'm curious as to what you had before? That's what you posted is exactly
what I would've done in the first place...

Andreas

-- 
Don't relax!  It's only your tension that's holding you together.




More information about the PyQt mailing list