PyQt5 – How to allow QColorDialog Widget to resize ?
In this article we will see how we can change the size of the QColorDialog. The QColorDialog has a fixed size, because it contains several custom widgets that aren’t designed to be resizable, although we can change the layout constraint to allow it to change size.
Note : The layout quickly becomes messed up with even a little bit of resizing. Also beyond a certain point, the dialog will get crashed due to floating-point exceptions, so it is not recommended to resize the dialog.
In order to do this we use
setSizeConstraint method with the QColorDialog object’s layout object
Syntax : dialog.layout().setSizeConstraint(QLayout.SetNoConstraint)
Argument : It takes layout size constraint object as argument
Return : It returns None
Below is the implementation
Please Login to comment...