Skip to content

Commit

Permalink
ModalMessageBox: Remove superfluous buttons and ensure correct parent
Browse files Browse the repository at this point in the history
  • Loading branch information
spycrab committed Mar 11, 2019
1 parent 8293724 commit 63fd931
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Core/DolphinQt/QtUtils/ModalMessageBox.cpp
Expand Up @@ -6,13 +6,14 @@

#include <QApplication>

ModalMessageBox::ModalMessageBox(QWidget* parent) : QMessageBox(parent)
ModalMessageBox::ModalMessageBox(QWidget* parent)
: QMessageBox(parent != nullptr ? parent->window() : nullptr)
{
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.
if (parent != nullptr && !parent->isVisible())
if (parent != nullptr && !parent->window()->isVisible())
setParent(nullptr);
}

Expand Down

0 comments on commit 63fd931

Please sign in to comment.