PyQt layout question: QScrollView and QGridLayout?

Volker Lenhardt volker.lenhardt at uni-due.de
Thu Nov 17 14:37:00 EST 2005


Phil Thompson schrieb:
> On Thursday 17 November 2005 2:56 pm, Volker Lenhardt wrote:
> 
>>prefer to use QGridLayout, but cannot add it to the scroll view.
>>
>>sc=QScrollView(self)
>>layout=QGridLayout(..., sc.viewport())
>>sc.addChild(layout)
>>
>>results in a TypeError.
>>
>>Is there a way to get it to work? Filling a box viewport with lots of
>>padding boxes and white space labels to establish grids is very
>>cumbersome. And I need 4 different layouts to change places.
> 
> 
> QGridLayout is not a sub-class of QWidget, which is what addChild() is 
> expecting. You probably want QGrid.
> 
> Phil

I hoped to find a more assuring answer. There's no MultiCellWidget, no 
Col/RowStretching, no Col/RowSpacing in QGrid. I've got to patch up one 
VBox with a whole bunch of QV/QHBoxes and QGrids not to mention the 
white space QLabels to fill not used grid cells.

And I have to delete all of them to change to another data layout.

Are you sure that there's no way to fill a QScrollView with the help of 
some QLayout?

Still hopefully
Volker



More information about the Python-list mailing list