In this article we will see how we can accept the QColorDialog widget. Accepting hides the modal dialog and sets the result code to accepted, it is same when user press ‘OK’ button.
This method calls the finished signal
In order to do this we use
accept method with the QColorDialog object
Syntax : dialog.accept()
Argument : It takes no argument
Return : It returns None
Below is the implementation
Note : In this implementation we didn’t execute the color dialog because we set the current color and accept the color programmatically will make it selected color instead of white which is default
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