I am trying to write a function to better manage QMessageBoxes for the program I am designing. It takes a number of parameters and creates a custom QMessageBox based on those parameters. A simple form this function would be called will be like this: However, I am having trouble getting the value of the pressed button. I have tried the