PyQt5 – Set fix window size for height or width
When we create a window, by default the window size is resizable although, we can use
setFixedSize() method to set the fixed size of the window but if we want to set only fix length of height or width only we cant use this method. We want to set one length fixed and other be variable in order to do so we have to use
setFixedWidth() method to set fix length of width and
setFizedHeight() method to set fix length of height.
Syntax :self.setFixedWidth(width) self.setFixedHeight(height)
Argument : Both take integer as argument.
setFixedWidth()sets the constant width.
setFixedWidth()sets the constant height.
Code for fixed width –
Code for fixed height –
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course