Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a spacer line between layouts PyQt

Tags:

python

pyqt

pyqt4

I would like to add a spacer line between two layouts:

Separador = QFrame()
Separador.Shape(QFrame.HLine)
Separador.setSizePolicy(QSizePolicy.Minimum,QSizePolicy.Expanding)
Separador.setLineWidth(3)
HPOUT1_layout = QVBoxLayout()
HPOUT1_layout.addLayout(HPOUT1L_layout)
HPOUT1_layout.addWidget(Separador)
HPOUT1_layout.addLayout(HPOUT1R_layout)

However, this code only separate the layouts a little, but there is no line visible between them. Is there another way, What I'm doing wrong?

like image 825
Mr_LinDowsMac Avatar asked Sep 06 '25 03:09

Mr_LinDowsMac


1 Answers

You are not setting the shape of the frame correctly.

Instead of

Separador.Shape(QFrame.HLine)

use

Separador.setFrameShape(QFrame.HLine)
like image 83
Mel Avatar answered Sep 10 '25 11:09

Mel