Reputation: 4062
I've instantiated a QMessageBox and added a couple of buttons to it like so:
QMessageBox message;
cancelButton = message.addButton(tr("Cancel"), QMessageBox::RejectRole);
okButton = message.addButton(tr("OK"), QMessageBox::ActionRole);
Is it necessary to call the destructors for each pushbutton before exiting, or does the QMessageBox destructor take care of everything?
Upvotes: 0
Views: 219
Reputation: 14441
No.
When parent objects are deleted they delete their children. So the buttons will be deleted when 'message' is.
Upvotes: 4