Permalink
Browse files

Qt/CheatWarningWidget: properly supply a parent for the widget

Because it wasn't parented properly, it would show briefly the widget in its own window when creating an ARCodeWidget or a GeckoCodeWidget which would occur when accessing the game properties page or when the state changes to pause/running.
  • Loading branch information...
aldelaro5 committed May 18, 2018
1 parent 5b96abf commit 6dd5a3a8669076cb5be588d6e9cefa4f7cf6ac27
@@ -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..."));
@@ -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();
@@ -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();
@@ -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;

0 comments on commit 6dd5a3a

Please sign in to comment.