[PyQt] Collapse/expand frame

Peter Shinners pshinners at blizzard.com
Thu Aug 20 17:21:26 BST 2009


I have used created these types of collapsible frames before and keeping them inside a scroll area. It flickers on all platforms (Win, Linux, and OSX) and all the versions of Qt between 3 and 4.3. 

In short, hiding/exposing widgets in a scroll area will always flicker. I was hopeful the Qt switch to client-side windows in 4.5 would fix the flickering, but from what I've heard it does not.


-----Original Message-----
From: pyqt-bounces at riverbankcomputing.com [mailto:pyqt-bounces at riverbankcomputing.com] On Behalf Of Alexei Puzikov
Sent: Wednesday, August 19, 2009 9:59 PM
To: Hans-Peter Jansen
Cc: pyqt at riverbankcomputing.com
Subject: Re: [PyQt] Collapse/expand frame

I've done some testing. The majour problem here seems to be
QVBoxLayout is sending resizeEvent (or doing something else
that sends such event) to all the children widgets that has their own Layouts.

And this causes flickering.

Anybody can figure out why?

A.

On Fri, Aug 14, 2009 at 11:50 PM, Hans-Peter Jansen<hpj at urpla.net> wrote:
> Am Freitag, 14. August 2009 schrieb Alexei Puzikov:
>> >> Actually, you do, as soon as you'll pass over some amount of controls.
>> >>
>> >> I have the editor here that reimplements the screenshot (it's Maya,
>> >> btw) and in worst situations contains approx. 4500 controls. And I'm
>> >> still unable to remove
>> >> flickering on switch - basically, the layout refresh.
>> >>
>> >> If anybody can prototype something that works with big amount of
>> >> controls - his help would be enormous. Really.
>> >
>> > Hmm, Alexei, please don't feel offended, but presenting 4500 controls
>> > to user basically sounds like a pathologic situation, where _concepts_
>> > lost control ;-)...
>>
>> Well, it's probably Friday evening fluctuated my math a little bit -
>> so, in worst case,
>> it's 1500 controls. Which is actually pretty easy to achieve: 2
>> spacers, label, editor and slider
>> for each parameter.
>
> Ahh, okay, we're talking about 500 composite widgets then - which is where
> things start to get imaginable ;-)
>
>> > How is a user supposed to master that? Something similar to
>> > car navigation for the screen? (Take the second branch right, move
>> > mouse 200mm north, you reached your target, it's on the left side..)
>>
>> Well, that's what makes my job interesting :) Yes, it's a tough UI
>> stuff. Filtering, proper
>> grouping, good usable search, tagging, good documentation and most of
>> all - good default values :)
>>
>> > Even, if that widget, or control, if you like, is implemented in C++,
>> > as long as it is resizing itself, flickering cannot be suppressed,
>> > since it forces Qt to redraw the whole frame. I would start looking,
>> > how to get the whole thing into managable pieces. Next you may try to
>> > use a home grown layout manager, that is optimized for these cases
>> > (e.g. moves screen areas, but that's going to be tough, don't it?)
>>
>> I'm not sure. What actually bugs me is that layout engine is
>> repainting the widgets
>> that's haven't changed their geometry. Given how many layouts I have,
>> this flickers....
>>
>> You think this might be overwritten?...
>
> What I had in mind was a layout manager, that's being aware of the
> situation: repaint only small screen areas (the widget, that is resizing
> itself), and copying the unchanged screen areas around, its doable but
> that's going to be a tough job, I assume.
>
> Pete
>
_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt



More information about the PyQt mailing list