[PyQt] Collapse/expand frame
havard at lurtgjort.no
Thu Aug 13 22:24:03 BST 2009
On Thu, Aug 13, 2009 at 7:51 PM, Scott Ballard<scott at scottballard.net> 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?
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.
> Many thanks!
> 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)
>> PyQt mailing list PyQt at riverbankcomputing.com
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4330 (20090812) __________
>> The message was checked by ESET NOD32 Antivirus.
> __________ Information from ESET NOD32 Antivirus, version of virus signature
> database 4332 (20090813) __________
> The message was checked by ESET NOD32 Antivirus.
> PyQt mailing list PyQt at riverbankcomputing.com
Håvard Gulldahl <havard at gulldahl.no>
Telefon: 9971 0615
More information about the PyQt