Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PySide: set width of QVBoxLayout

Tags:

python

pyside

With PySide, I have a set of QWidget in a QVBoxLayout

vlayout = QVBoxLayout()
vlayout.addWidget(self.a_label)
vlayout.addWidget(self.a)

I can set the width of widget with

self.a.setFixedWidth(60)

but If I try set the width of QVBoxLayout with setGeometry

vlayout.setGeometry(QRect(100, 100, 100, 100))

I don't get changes.

How I can set the width of a QVBoxLayout ?

like image 236
JuanPablo Avatar asked Nov 06 '13 14:11

JuanPablo


1 Answers

I solved, putting the QVBoxLayout in a QWidget and fixed the width of QWidget

v_widget = QWidget()
v_widget.setLayout(vlayout)
v_widget.setFixedWidth(80)
like image 192
JuanPablo Avatar answered Sep 27 '22 20:09

JuanPablo