I am using python and PyQt to design a simple interface.
My question is this:
How do I set an initial width of a pyqt widget in a splitter while still allowing it to be modified by the user when they drag the divider?
I want one of the two widgets in the splitter to be narrower when the application first launches and I also want the user to be able to manually change the width by dragging on the divider. I tried setting the maximum width in Qt-Designer and then when the application launches the widget is narrower but you can not drag the dividing line to expand it. If I don't set any maximum widths then when the app launches they each take up 50% but I can drag the divider around manually to adjust the ratio.
Did you try?:
QSplitter.setSizes (self, list-of-int list)
###Sets the child widgets respective sizes to the values given in the list.
You have here a working example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With