PySide: set QVBoxLayout width

With PySide, I have a QWidget set in a QVBoxLayout

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

I can set the width of the widget with

self.a.setFixedWidth(60)

but if I try to set the width QVBoxLayoutwithsetGeometry

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

I do not get changes.

How to set QVBoxLayout width?

+4
source share
1 answer

I decided by putting QVBoxLayoutin QWidgetand fixing the width of the QWidget

v_widget = QWidget()
v_widget.setLayout(vlayout)
v_widget.setFixedWidth(80)
+9
source

All Articles