Qt: Remove a few more instances of QDialog::exec()#3623
Qt: Remove a few more instances of QDialog::exec()#3623stenzek merged 1 commit intostenzek:masterfrom
QDialog::exec()#3623Conversation
|
FYI, it's only needed when the dialog is window modal. Application modal is fine. Hence why I didn't bother replacing these. |
8f1656a to
84d0b16
Compare
|
Yeah, this PR isn't really meant to fix anything (nothing is broken here). I just feel it's cleaner to avoid the nested event loops started by |
|
Sorry for the large-ish commit. To summarize:
|
|
I'm not really sure what the benefit to creating the new classes is - they're not moc-invokable, and there's no point keeping the pointers to the widgets around since they're not accessed afterwards? |
|
Good question. I was mainly following the pattern that when you have a |
|
You shouldn't need to keep the Ui::Whatever instance live. It allocates all the widgets on the heap and parents them to the widget that's passed in. |
|
|
||
| QMessageBox* const mb = QtUtils::NewMessageBox(QMessageBox::Warning, tr("CPU Overclocking Warning"), message, | ||
| QMessageBox::NoButton, QMessageBox::NoButton, Qt::WindowModal, this); | ||
| mb->setAttribute(Qt::WA_DeleteOnClose, true); |
There was a problem hiding this comment.
This should not be removed. Might be easier to just merge and re-add it.
There was a problem hiding this comment.
I just moved it to QtUtils::NewMessageBox()
Need to do some more testing.