[PyKDE] autoAdding buttons to a grid

Richard Smith smithbone at gmail.com
Fri May 20 03:04:07 BST 2005


> 
> Here's a crude example that may do something like what you were
> originally trying to do:

Yes.  Thats pretty much exactly what I want to do only in a
QButtonGroup.  I would also like to be able to change the number of
columns as well.  For one series of buttons a 2 x 3 grid may be what I
wan't but on the next set of buttons a 4 x 4 grid may be a better
choice.

I tried to use your same QGrid model with a QButtonGroup but there is
still a piece of the puzzle I'm missing as just creating a
QButtonGroup and then adding the QGrid to that dosen't produce the
same results.  The QButtonGroup dosen't resize when you resize the
QGrid.  Resizing the QButtonGroup dosen't resize the QGrid. Will I
have to resize them both?

I Also tried with a QButtonGroup and QGridLayout like what Qt Designer
and pyuic generates for a button group with grid layout but didn't
have much success there either.

-- 
Richard A. Smith




More information about the PyQt mailing list