mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 05:21:25 +12:00
Qt: fix settings_dialog opening on wrong tab
The dialog now uses open instead of exec, so we have to override open.
This commit is contained in:
parent
79fc366f23
commit
c56147e04b
2 changed files with 7 additions and 12 deletions
|
@ -94,7 +94,7 @@ void remove_item(QComboBox* box, int data_value, int def_value)
|
||||||
|
|
||||||
extern const std::map<std::string_view, int> g_prx_list;
|
extern const std::map<std::string_view, int> g_prx_list;
|
||||||
|
|
||||||
settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, const int& tab_index, QWidget* parent, const GameInfo* game, bool create_cfg_from_global_cfg)
|
settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, int tab_index, QWidget* parent, const GameInfo* game, bool create_cfg_from_global_cfg)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, m_tab_index(tab_index)
|
, m_tab_index(tab_index)
|
||||||
, ui(new Ui::settings_dialog)
|
, ui(new Ui::settings_dialog)
|
||||||
|
@ -2607,14 +2607,11 @@ void settings_dialog::ApplyStylesheet(bool reset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int settings_dialog::exec()
|
void settings_dialog::open()
|
||||||
{
|
{
|
||||||
// singleShot Hack to fix following bug:
|
QDialog::open();
|
||||||
// If we use setCurrentIndex now we will miraculously see a resize of the dialog as soon as we
|
|
||||||
// switch to the cpu tab after conjuring the settings_dialog with another tab opened first.
|
ui->tab_widget_settings->setCurrentIndex(m_tab_index);
|
||||||
// Weirdly enough this won't happen if we change the tab order so that anything else is at index 0.
|
|
||||||
ui->tab_widget_settings->setCurrentIndex(0);
|
|
||||||
QTimer::singleShot(0, [this]{ ui->tab_widget_settings->setCurrentIndex(m_tab_index); });
|
|
||||||
|
|
||||||
// Open a dialog if your config file contained invalid entries
|
// Open a dialog if your config file contained invalid entries
|
||||||
QTimer::singleShot(10, [this]
|
QTimer::singleShot(10, [this]
|
||||||
|
@ -2640,8 +2637,6 @@ int settings_dialog::exec()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return QDialog::exec();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void settings_dialog::SubscribeDescription(QLabel* description)
|
void settings_dialog::SubscribeDescription(QLabel* description)
|
||||||
|
|
|
@ -21,9 +21,9 @@ class settings_dialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit settings_dialog(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, const int& tab_index = 0, QWidget* parent = nullptr, const GameInfo* game = nullptr, bool create_cfg_from_global_cfg = true);
|
explicit settings_dialog(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, int tab_index = 0, QWidget* parent = nullptr, const GameInfo* game = nullptr, bool create_cfg_from_global_cfg = true);
|
||||||
~settings_dialog();
|
~settings_dialog();
|
||||||
int exec() override;
|
void open() override;
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void GuiStylesheetRequest();
|
void GuiStylesheetRequest();
|
||||||
void GuiRepaintRequest();
|
void GuiRepaintRequest();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue