[Qt-interest] Dynamic QGridLayout

Murphy, Sean M. sean.murphy at gd-ais.com
Fri Feb 27 15:06:19 CET 2009


Trying adding a vertical spacer widget as the bottom widget in each
column.  This should "push" the visible widgets up when one gets hidden.
Then arrange each column in a QVBoxLayout, then arrange the 2
QVBoxLayout's in a QHBoxLayout.

I've included a simple example that I think does what you want.  Click
on buttons 1-4 to hide them, click the Unhide All button to show any
that were previously hidden.

Sean

-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Luper Rouch
Sent: Friday, February 27, 2009 3:00 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Dynamic QGridLayout

Hello,

I have a two columns set of widgets in a QGridLayout. I would like the 
layout to rearrange properly when I show or hide widgets in it. Right 
now if I hide things in it I get "holes" in the columns, here is an 
ASCII art explanation :

Before:
* *
* *

After hiding (0, 0) and (1, 1):
   *
*

But I would like to get this:
* *

How can I do that ?
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HideUnhide.zip
Type: application/x-zip-compressed
Size: 2644 bytes
Desc: HideUnhide.zip
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090227/57d81b8d/attachment.bin 


More information about the Qt-interest-old mailing list