RE: [PyQt] Collapse/expand frame

2009-08-20 Thread Peter Shinners
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-boun...@riverbankcomputing.com 
[mailto:pyqt-boun...@riverbankcomputing.com] On Behalf Of Alexei Puzikov
Sent: Wednesday, August 19, 2009 9:59 PM
To: Hans-Peter Jansen
Cc: pyqt@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 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 listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-19 Thread Alexei Puzikov
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 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 listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-14 Thread Hans-Peter Jansen
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 listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-14 Thread 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.

> 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?...

A.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-14 Thread Hans-Peter Jansen
Am Freitag, 14. August 2009 schrieb Scott Ballard:
> Thanks for all the feedback. Are there any good tutorials for
> implementing your own custom widgets/layouts? (if no one has an
> implementation of this)

Here is one:
http://doc.trolltech.com/qq/qq26-pyqtdesigner.html

and another:
http://diotavelli.net/PyQtWiki/Using_Python_Custom_Widgets_in_Qt_Designer

One downside of subclassing QWidget is the layout manager from Mac OS-X 
using maximum spacing around it, see "my" thread: QStyle manipulations. 
If you're not targetting that OS, you don't need to care. 

>  Cheers,
>  -Scott
>
>  Alexei Puzikov wrote:
> I'm really looking for a frame that has the collapse/expand ability
> built into it. See the image in the link. You can see the Texture Map
> submenu  collapsed/expanded. Any thoughts?
>
> www.scottballard.net/collapsibleFrame.jpg
>
> I see - why don't you BYO. This kind of widget is uncommon, and thus the
> reason not being available already.
>
> But it's pretty easy to combine basic widgets to a composite one. And due
> to Qts powerful layout machinery, you mostly don't need to care about the
> implicit widget resize.
>
>
> 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 ;-)... 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..)

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?)

Pete

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-13 Thread Scott Ballard




Thanks for all the feedback. Are
there any good tutorials for implementing your own custom
widgets/layouts? (if no one has an implementation of this)

Cheers,
-Scott

Alexei Puzikov wrote:

  

  I'm really looking for a frame that has the collapse/expand ability
built into it. See the image in the link. You can see the Texture Map
submenu  collapsed/expanded. Any thoughts?

www.scottballard.net/collapsibleFrame.jpg
  

I see - why don't you BYO. This kind of widget is uncommon, and thus the
reason not being available already.

But it's pretty easy to combine basic widgets to a composite one. And due to
Qts powerful layout machinery, you mostly don't need to care about the
implicit widget resize.

  
  
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.

A.

__ Information from ESET NOD32 Antivirus, version of virus signature database 4333 (20090813) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




  



__ Information from ESET NOD32 Antivirus, version of virus signature database 4333 (20090813) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Collapse/expand frame

2009-08-13 Thread Alexei Puzikov
>> I'm really looking for a frame that has the collapse/expand ability
>> built into it. See the image in the link. You can see the Texture Map
>> submenu  collapsed/expanded. Any thoughts?
>>
>> www.scottballard.net/collapsibleFrame.jpg
>
> I see - why don't you BYO. This kind of widget is uncommon, and thus the
> reason not being available already.
>
> But it's pretty easy to combine basic widgets to a composite one. And due to
> Qts powerful layout machinery, you mostly don't need to care about the
> implicit widget resize.

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.

A.

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-13 Thread Alexei Puzikov
Well - have you tried to do that with 1500 controls?

A.

On Fri, Aug 14, 2009 at 9:24 AM, Håvard Gulldahl wrote:
> On Thu, Aug 13, 2009 at 7:51 PM, Scott Ballard wrote:
>> I'm really looking for a frame that has the collapse/expand ability built
>> into it. See the image in the link. You can see the Texture Map submenu
>>  collapsed/expanded. Any thoughts?
>>
>> www.scottballard.net/collapsibleFrame.jpg
>>
>
> I've done something similar, sans the arrow. I have a checkable
> QGroupBox, whose sole child is a QFrame with no borders. All the
> widgets I put into the QFrame. Then I connect the toggled(bool) signal
> of the group box to the frame's setShown(bool) slot. That way, the
> QFrame is hidden when the QGroupBox is un-checked. And you can do it
> all from the Qt Designer: less hand-written code, yay!
>
> Originally I meant to figure out how to customize the QGroupBox so
> that it has an arrow (like in the example you're referencing) and not
> a cross, but it's not high on the list. The check box works fine, IMO.
>
> Cheers,
>
> Håvard
>
>
>> Many thanks!
>> -Scott
>>
>>
>> Hans-Peter Jansen wrote:
>>>
>>> Am Mittwoch, 12. August 2009 schrieb Scott Ballard:
>>>

 Does anyone know of a way to collapse/expand a frame or a group box that
 contains widgets in it? I don't see anything in the docs or Google about
 it, but it would seem like something common.

>>>
>>> Try .hide()/.show() resp. .setVisible(bool)
>>>
>>> Pete
>>> ___
>>> PyQt mailing list    p...@riverbankcomputing.com
>>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>>
>>> __ Information from ESET NOD32 Antivirus, version of virus
>>> signature database 4330 (20090812) __
>>>
>>> The message was checked by ESET NOD32 Antivirus.
>>>
>>> http://www.eset.com
>>>
>>>
>>>
>>>
>>>
>>
>>
>> __ Information from ESET NOD32 Antivirus, version of virus signature
>> database 4332 (20090813) __
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>> ___
>> PyQt mailing list    p...@riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>
>
>
> --
> Håvard Gulldahl 
> Telefon: 9971 0615
> http://lurtgjort.no/
>
> ___
> PyQt mailing list    p...@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-13 Thread Håvard Gulldahl
On Thu, Aug 13, 2009 at 7:51 PM, Scott Ballard wrote:
> I'm really looking for a frame that has the collapse/expand ability built
> into it. See the image in the link. You can see the Texture Map submenu
>  collapsed/expanded. Any thoughts?
>
> www.scottballard.net/collapsibleFrame.jpg
>

I've done something similar, sans the arrow. I have a checkable
QGroupBox, whose sole child is a QFrame with no borders. All the
widgets I put into the QFrame. Then I connect the toggled(bool) signal
of the group box to the frame's setShown(bool) slot. That way, the
QFrame is hidden when the QGroupBox is un-checked. And you can do it
all from the Qt Designer: less hand-written code, yay!

Originally I meant to figure out how to customize the QGroupBox so
that it has an arrow (like in the example you're referencing) and not
a cross, but it's not high on the list. The check box works fine, IMO.

Cheers,

Håvard


> Many thanks!
> -Scott
>
>
> Hans-Peter Jansen wrote:
>>
>> Am Mittwoch, 12. August 2009 schrieb Scott Ballard:
>>
>>>
>>> Does anyone know of a way to collapse/expand a frame or a group box that
>>> contains widgets in it? I don't see anything in the docs or Google about
>>> it, but it would seem like something common.
>>>
>>
>> Try .hide()/.show() resp. .setVisible(bool)
>>
>> Pete
>> ___
>> PyQt mailing list    p...@riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>> __ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4330 (20090812) __
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>>
>>
>
>
> __ Information from ESET NOD32 Antivirus, version of virus signature
> database 4332 (20090813) __
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
> ___
> PyQt mailing list    p...@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>



-- 
Håvard Gulldahl 
Telefon: 9971 0615
http://lurtgjort.no/

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-13 Thread Hans-Peter Jansen
Am Donnerstag, 13. August 2009 schrieb Scott Ballard:
> I'm really looking for a frame that has the collapse/expand ability
> built into it. See the image in the link. You can see the Texture Map
> submenu  collapsed/expanded. Any thoughts?
>
> www.scottballard.net/collapsibleFrame.jpg

I see - why don't you BYO. This kind of widget is uncommon, and thus the 
reason not being available already. 

But it's pretty easy to combine basic widgets to a composite one. And due to 
Qts powerful layout machinery, you mostly don't need to care about the 
implicit widget resize. 

Custom composite widgets have some pitfalls in the details, but just start 
over, we will help you getting through.

Pete
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-13 Thread Scott Ballard
I'm really looking for a frame that has the collapse/expand ability 
built into it. See the image in the link. You can see the Texture Map 
submenu  collapsed/expanded. Any thoughts?


www.scottballard.net/collapsibleFrame.jpg

Many thanks!
-Scott


Hans-Peter Jansen wrote:

Am Mittwoch, 12. August 2009 schrieb Scott Ballard:
  

Does anyone know of a way to collapse/expand a frame or a group box that
contains widgets in it? I don't see anything in the docs or Google about
it, but it would seem like something common.



Try .hide()/.show() resp. .setVisible(bool)

Pete
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

__ Information from ESET NOD32 Antivirus, version of virus signature 
database 4330 (20090812) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




  



__ Information from ESET NOD32 Antivirus, version of virus signature 
database 4332 (20090813) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Collapse/expand frame

2009-08-12 Thread Hans-Peter Jansen
Am Mittwoch, 12. August 2009 schrieb Scott Ballard:
> Does anyone know of a way to collapse/expand a frame or a group box that
> contains widgets in it? I don't see anything in the docs or Google about
> it, but it would seem like something common.

Try .hide()/.show() resp. .setVisible(bool)

Pete
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt