
Originally Posted by
powerofpi
Thank you for your ideas.
1) & 4) The reason I emit a signal on accept() is because I need to get the index of the spinbox that was selected. If there's a better way to do this, let me know!
2) Why would this be a bad thing? I need to free the memory before the dialog ceases to exist, right?
2) When a QObject are destroyed, it delete all children. You have not need to delete them explicitly
For the 1) I suggest you to define a difficulty() public methods that returns m_difficulty and call it after exec from calling code
// For modal Dialog (exec()) you can use a stack variable
GenerateNewDialog dlg(this);
if (QDialog::Accepted == generateNewDialog.
exec()) { difficulty = dlg.difficulty();
}
// For modal Dialog (exec()) you can use a stack variable
GenerateNewDialog dlg(this);
if (QDialog::Accepted == generateNewDialog.exec()) {
difficulty = dlg.difficulty();
}
To copy to clipboard, switch view to plain text mode
Bookmarks