Insert QLabel in QFrame
Solved
Qt for Python
-
wrote on 31 Oct 2021, 10:34 last edited by
I am trying to insert Qlabels in a QFrame by doing so:
frame = QFrame() QLabel("Title",frame) QLabel("Year",frame)
However, only the last added label is visible, is there something missing ?
-
I am trying to insert Qlabels in a QFrame by doing so:
frame = QFrame() QLabel("Title",frame) QLabel("Year",frame)
However, only the last added label is visible, is there something missing ?
wrote on 31 Oct 2021, 10:50 last edited by@celke What happens is that one of them is on top of the other. Use layout:
frame = QFrame() title_label = QLabel("Title") year_label = QLabel("Year") lay = QVBoxLayout(frame) lay.addWidget(title_label) lay.addWidget(year_label)
-
wrote on 31 Oct 2021, 11:11 last edited by
This works perfect, thanks
-
wrote on 31 Oct 2021, 11:12 last edited byThis post is deleted!
4/4