Dec-02-2018, 04:48 PM
You have to set the vertical policy for your button (either as minimum or expanding):
As for the constructive critisism, you should avoid wildcard in imports as it is considered bad practice:
sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) self.quitButton.setSizePolicy(sizePolicy)When you want to change the layout but don't know where to start, a trick is to mess in QtDesigner until you find the right setting. Then save the ui file, convert it to python and see how it is done :)
As for the constructive critisism, you should avoid wildcard in imports as it is considered bad practice:
from PyQt5.QtWidgets import *And always use explicit inheritances, such as:
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)It makes it clear on which module your application rely, and avoid name collision.