Merge pull request #6890 from aldelaro5/qt-fix-random-windows

Qt/CheatWarningWidget: properly supply a parent for the widget
This commit is contained in:
spycrab 2018-05-18 08:08:42 +02:00 committed by GitHub
commit 9bdf7c4b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View File

@ -40,7 +40,7 @@ ARCodeWidget::ARCodeWidget(const UICommon::GameFile& game, bool restart_required
void ARCodeWidget::CreateWidgets()
{
m_warning = new CheatWarningWidget(m_game_id, m_restart_required);
m_warning = new CheatWarningWidget(m_game_id, m_restart_required, this);
m_code_list = new QListWidget;
m_code_add = new QPushButton(tr("&Add New Code..."));
m_code_edit = new QPushButton(tr("&Edit Code..."));

5
Source/Core/DolphinQt2/Config/CheatWarningWidget.cpp Normal file → Executable file
View File

@ -14,8 +14,9 @@
#include "Core/Core.h"
#include "DolphinQt2/Settings.h"
CheatWarningWidget::CheatWarningWidget(const std::string& game_id, bool restart_required)
: m_game_id(game_id), m_restart_required(restart_required)
CheatWarningWidget::CheatWarningWidget(const std::string& game_id, bool restart_required,
QWidget* parent)
: QWidget(parent), m_game_id(game_id), m_restart_required(restart_required)
{
CreateWidgets();
ConnectWidgets();

2
Source/Core/DolphinQt2/Config/CheatWarningWidget.h Normal file → Executable file
View File

@ -15,7 +15,7 @@ class CheatWarningWidget : public QWidget
{
Q_OBJECT
public:
explicit CheatWarningWidget(const std::string& game_id, bool restart_required);
explicit CheatWarningWidget(const std::string& game_id, bool restart_required, QWidget* parent);
signals:
void OpenCheatEnableSettings();

2
Source/Core/DolphinQt2/Config/GeckoCodeWidget.cpp Normal file → Executable file
View File

@ -43,7 +43,7 @@ GeckoCodeWidget::GeckoCodeWidget(const UICommon::GameFile& game, bool restart_re
void GeckoCodeWidget::CreateWidgets()
{
m_warning = new CheatWarningWidget(m_game_id, m_restart_required);
m_warning = new CheatWarningWidget(m_game_id, m_restart_required, this);
m_code_list = new QListWidget;
m_name_label = new QLabel;
m_creator_label = new QLabel;