In this article we will see how we can reject the color in the QColorDialog widget. Hides the modal dialog and sets the result code to Rejected., it is same when user press ‘Cancel’ button.
This method call the finished signal
In order to do this we use
reject method with the QColorDialog object
Syntax : dialog.reject()
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 but then the reject method get called which will remove the color so the color becomes black
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