I'm using MessageBox to get user input if data is to be added to database, but I don't know how to place my variables inside the actual message. MessageBox function looks like this:
def message(self, par_1, par_2):
odp = QMessageBox.question(self, 'Information', "No entry. Would you like to add it to DB?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
if odp == QMessageBox.Yes:
return True
else:
return False
Function is called like this:
self.message(autor_firstname, autor_lastname)
I tried adding:
odp.setDetailText(par_1, par_2)
But it didn't work as expected. Additionally I have problem when user clicks "No". Program crashes instead of returning to main window.