Answer the question
In order to leave comments, you need to log in
How to set widget size as a percentage in PyQt5?
I want the widget to be 20% long and 100% high
Answer the question
In order to leave comments, you need to log in
As a percentage of what?
For widgets in the layout set strech parameters
widg1.setHorizontalStretch(1)
widg2.setHorizontalStretch(2)
In addition, you can play around with QSS styles.
As an example
checkbutton.setStyleSheet("QPushButton {background-color:rgb(0,200,0) ; color: White; border-radius: 3px; height:15%; width:70%} "
"QPushButton:pressed {background-color:rgb(0,150,0) ; }")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question