I have a vertical QProgressBar that lives in a horizontal layout, between two QTextEdit objects. In Designer, I've changed the width of the progress bar using a stylesheet, which works to a degree - but I can't shrink the width below about 17 pixels. I'd like it to be very narrow - maybe around 5px or so - but changing the stylesheet and the minimum size in Designer just won't change it to be that narrow.
Asked
Active
Viewed 2,783 times
1
-
I changed the value of the Width field in designer instead of stylesheet. It works for me. Also, how are you changing the width from stylesheet? I wouldn't want to do it that way.. – Aditya Mar 29 '18 at 15:05
1 Answers
1
You can change the size of any widget in a number of ways:
Designer - In the designer forms, you will find a width field under Geometry
. Set the width you want to set here.
Code - There are a a number of accessible functions for most, if not all predefined widgets in Qt. Qwidget::setFixedWidth()
, or QWidget::setGeometry
could be useful.
Keep in mind that whatever you set in code will generally take precedence over the value in designer, based on latest executed statement.
PS- I have tried but been unsuccessful in setting the size through stylesheet. I think it may be unreliable.

Aditya
- 439
- 4
- 14