mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
ModalMessageBox: Remove superfluous buttons and ensure correct parent
This commit is contained in:
@ -6,13 +6,14 @@
|
|||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
ModalMessageBox::ModalMessageBox(QWidget* parent) : QMessageBox(parent)
|
ModalMessageBox::ModalMessageBox(QWidget* parent)
|
||||||
|
: QMessageBox(parent != nullptr ? parent->window() : nullptr)
|
||||||
{
|
{
|
||||||
setWindowModality(Qt::WindowModal);
|
setWindowModality(Qt::WindowModal);
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(Qt::Sheet | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
|
||||||
|
|
||||||
// No parent is still preferable to showing a hidden parent here.
|
// No parent is still preferable to showing a hidden parent here.
|
||||||
if (parent != nullptr && !parent->isVisible())
|
if (parent != nullptr && !parent->window()->isVisible())
|
||||||
setParent(nullptr);
|
setParent(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user