Qt: Clear help text map on reload

Saves keeping messages around for pointers that are no longer valid.
This commit is contained in:
Stenzek 2025-07-13 17:32:54 +10:00
parent 8ef97b9b46
commit b93353647f
No known key found for this signature in database

View File

@ -183,6 +183,10 @@ void SettingsWindow::addPages()
&GraphicsSettingsWidget::onShowDebugSettingsChanged);
SettingWidgetBinder::BindWidgetToBoolSetting(m_sif.get(), m_ui.safeMode, "Main", "DisableAllEnhancements", false);
registerWidgetHelp(m_ui.safeMode, tr("Safe Mode"), tr("Unchecked"),
tr("Disables all enhancement options, simulating the system as accurately as possible. Use to "
"quickly determine whether an enhancement is responsible for game bugs."));
}
void SettingsWindow::reloadPages()
@ -205,6 +209,8 @@ void SettingsWindow::reloadPages()
m_ui.safeMode->disconnect();
}
m_widget_help_text_map.clear();
m_current_help_widget = nullptr;
addPages();
}
@ -238,10 +244,6 @@ void SettingsWindow::connectUi()
connect(m_ui.copyGlobalSettings, &QPushButton::clicked, this, &SettingsWindow::onCopyGlobalSettingsClicked);
if (m_ui.clearGameSettings)
connect(m_ui.clearGameSettings, &QPushButton::clicked, this, &SettingsWindow::onClearSettingsClicked);
registerWidgetHelp(m_ui.safeMode, tr("Safe Mode"), tr("Unchecked"),
tr("Disables all enhancement options, simulating the system as accurately as possible. Use to "
"quickly determine whether an enhancement is responsible for game bugs."));
}
void SettingsWindow::addWidget(QWidget* widget, QString title, QString icon, QString help_text)