Pyside QListWidget sizing issues

Pyside QListWidget sizing issues

Craig_Lamorte
Advocate Advocate
2,211 Views
1 Reply
Message 1 of 2

Pyside QListWidget sizing issues

Craig_Lamorte
Advocate
Advocate

Hi,

 

I am having issues with getting the QListWidget to size properly.  On default the list box extends to the bottom of the window.  I tried to set a max height or fixed height to the widget, like so -

 

self.aisle_list = QtWidgets.QListWidget()

self.aisle_list.setMaximumHeight(200)

 

And it works, except when I do that all of my other layouts above all get stretched to fit the entire window (everything gets shifted down).  To be clear I have this listwidget in a separate layout from all other layouts, and the other layouts are contained within a vertical layout that is top aligned.

 

How do i resize a listwidget without messing up all the other layouts

 

 

0 Likes
2,212 Views
1 Reply
Reply (1)
Message 2 of 2

RFlannery1
Collaborator
Collaborator

You could try putting a QSpacerItem after the list widget.  You may not even have to call it directly.  According to this page, you may be able to use the "addSpacing" function of the layout: http://doc.qt.io/qt-4.8/qspaceritem.html

0 Likes