Qt: Fix 6.7 deprecation warnings

This commit is contained in:
Stenzek 2024-04-11 21:48:59 +10:00
parent efcfcd8e11
commit 3e9ac99d54
No known key found for this signature in database
12 changed files with 24 additions and 27 deletions

View File

@ -73,11 +73,11 @@ AchievementSettingsWidget::AchievementSettingsWidget(SettingsWindow* dialog, QWi
tr(
"When enabled, the first disc in a playlist will be used for achievements, regardless of which disc is active."));
connect(m_ui.enable, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.hardcoreMode, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.hardcoreMode, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::onHardcoreModeStateChanged);
connect(m_ui.achievementNotifications, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.leaderboardNotifications, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.enable, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.hardcoreMode, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.hardcoreMode, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::onHardcoreModeStateChanged);
connect(m_ui.achievementNotifications, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.leaderboardNotifications, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.achievementNotificationsDuration, &QSlider::valueChanged, this,
&AchievementSettingsWidget::onAchievementsNotificationDurationSliderChanged);
connect(m_ui.leaderboardNotificationsDuration, &QSlider::valueChanged, this,

View File

@ -176,9 +176,9 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsWindow* dialog, QWidget*
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.showDebugMenu, "Main", "ShowDebugMenu", false);
connect(m_ui.resetToDefaultButton, &QPushButton::clicked, this, &AdvancedSettingsWidget::onResetToDefaultClicked);
connect(m_ui.showDebugMenu, &QCheckBox::stateChanged, g_main_window, &MainWindow::updateDebugMenuVisibility,
connect(m_ui.showDebugMenu, &QCheckBox::checkStateChanged, g_main_window, &MainWindow::updateDebugMenuVisibility,
Qt::QueuedConnection);
connect(m_ui.showDebugMenu, &QCheckBox::stateChanged, this, &AdvancedSettingsWidget::onShowDebugOptionsStateChanged);
connect(m_ui.showDebugMenu, &QCheckBox::checkStateChanged, this, &AdvancedSettingsWidget::onShowDebugOptionsStateChanged);
m_ui.tweakOptionTable->setColumnWidth(0, 380);
m_ui.tweakOptionTable->setColumnWidth(1, 170);

View File

@ -50,7 +50,7 @@ AudioSettingsWidget::AudioSettingsWidget(SettingsWindow* dialog, QWidget* parent
m_ui.muted->setChecked(m_dialog->getEffectiveBoolValue("Audio", "OutputMuted", false));
connect(m_ui.volume, &QSlider::valueChanged, this, &AudioSettingsWidget::onOutputVolumeChanged);
connect(m_ui.fastForwardVolume, &QSlider::valueChanged, this, &AudioSettingsWidget::onFastForwardVolumeChanged);
connect(m_ui.muted, &QCheckBox::stateChanged, this, &AudioSettingsWidget::onOutputMutedChanged);
connect(m_ui.muted, &QCheckBox::checkStateChanged, this, &AudioSettingsWidget::onOutputMutedChanged);
updateVolumeLabel();
}
else

View File

@ -108,7 +108,7 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
m_ui.cpuClockSpeed->setEnabled(m_dialog->getEffectiveBoolValue("CPU", "OverclockEnable", false));
connect(m_ui.enableCPUClockSpeedControl, &QCheckBox::stateChanged, this,
connect(m_ui.enableCPUClockSpeedControl, &QCheckBox::checkStateChanged, this,
&ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked);
connect(m_ui.cpuClockSpeed, &QSlider::valueChanged, this, &ConsoleSettingsWidget::onCPUClockSpeedValueChanged);

View File

@ -19,7 +19,7 @@ ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent,
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableSDLSource, "InputSources", "SDL", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableSDLEnhancedMode, "InputSources",
"SDLControllerEnhancedMode", false);
connect(m_ui.enableSDLSource, &QCheckBox::stateChanged, this,
connect(m_ui.enableSDLSource, &QCheckBox::checkStateChanged, this,
&ControllerGlobalSettingsWidget::updateSDLOptionsEnabled);
connect(m_ui.ledSettings, &QToolButton::clicked, this, &ControllerGlobalSettingsWidget::ledSettingsClicked);
@ -62,7 +62,7 @@ ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent,
{
m_ui.useProfileHotkeyBindings->setChecked(
m_dialog->getBoolValue("ControllerPorts", "UseProfileHotkeyBindings", false));
connect(m_ui.useProfileHotkeyBindings, &QCheckBox::stateChanged, this, [this](int new_state) {
connect(m_ui.useProfileHotkeyBindings, &QCheckBox::checkStateChanged, this, [this](int new_state) {
m_dialog->setBoolValue("ControllerPorts", "UseProfileHotkeyBindings", (new_state == Qt::Checked));
emit bindingSetupChanged();
});

View File

@ -68,9 +68,9 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsWindow* dialog, QWidget
}
connect(m_ui.turboSpeed, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&EmulationSettingsWidget::onTurboSpeedIndexChanged);
connect(m_ui.vsync, &QCheckBox::stateChanged, this, &EmulationSettingsWidget::onVSyncChanged);
connect(m_ui.vsync, &QCheckBox::checkStateChanged, this, &EmulationSettingsWidget::onVSyncChanged);
connect(m_ui.rewindEnable, &QCheckBox::stateChanged, this, &EmulationSettingsWidget::updateRewind);
connect(m_ui.rewindEnable, &QCheckBox::checkStateChanged, this, &EmulationSettingsWidget::updateRewind);
connect(m_ui.rewindSaveFrequency, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
&EmulationSettingsWidget::updateRewind);
connect(m_ui.rewindSaveSlots, QOverload<int>::of(&QSpinBox::valueChanged), this,

View File

@ -94,8 +94,8 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
&GraphicsSettingsWidget::onAspectRatioChanged);
connect(m_ui.gpuDownsampleMode, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&GraphicsSettingsWidget::onDownsampleModeChanged);
connect(m_ui.trueColor, &QCheckBox::stateChanged, this, &GraphicsSettingsWidget::onTrueColorChanged);
connect(m_ui.pgxpEnable, &QCheckBox::stateChanged, this, &GraphicsSettingsWidget::updatePGXPSettingsEnabled);
connect(m_ui.trueColor, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onTrueColorChanged);
connect(m_ui.pgxpEnable, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::updatePGXPSettingsEnabled);
if (!dialog->isPerGameSettings() ||
(dialog->containsSettingValue("GPU", "Multisamples") || dialog->containsSettingValue("GPU", "PerSampleShading")))
@ -158,9 +158,10 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pgxpCPU, "GPU", "PGXPCPU", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pgxpVertexCache, "GPU", "PGXPVertexCache", false);
connect(m_ui.pgxpTextureCorrection, &QCheckBox::stateChanged, this,
connect(m_ui.pgxpTextureCorrection, &QCheckBox::checkStateChanged, this,
&GraphicsSettingsWidget::updatePGXPSettingsEnabled);
connect(m_ui.pgxpDepthBuffer, &QCheckBox::checkStateChanged, this,
&GraphicsSettingsWidget::updatePGXPSettingsEnabled);
connect(m_ui.pgxpDepthBuffer, &QCheckBox::stateChanged, this, &GraphicsSettingsWidget::updatePGXPSettingsEnabled);
// OSD Tab
@ -206,9 +207,9 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget*
"DumpVRAMWriteHeightThreshold",
Settings::DEFAULT_VRAM_WRITE_DUMP_HEIGHT_THRESHOLD);
connect(m_ui.vramWriteReplacement, &QCheckBox::stateChanged, this,
connect(m_ui.vramWriteReplacement, &QCheckBox::checkStateChanged, this,
&GraphicsSettingsWidget::onEnableAnyTextureReplacementsChanged);
connect(m_ui.vramWriteDumping, &QCheckBox::stateChanged, this,
connect(m_ui.vramWriteDumping, &QCheckBox::checkStateChanged, this,
&GraphicsSettingsWidget::onEnableVRAMWriteDumpingChanged);
// Debugging Tab

View File

@ -52,7 +52,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.createSaveStateBackups, "Main", "CreateSaveStateBackups",
Settings::DEFAULT_SAVE_STATE_BACKUPS);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableDiscordPresence, "Main", "EnableDiscordPresence", false);
connect(m_ui.renderToSeparateWindow, &QCheckBox::stateChanged, this,
connect(m_ui.renderToSeparateWindow, &QCheckBox::checkStateChanged, this,
&InterfaceSettingsWidget::onRenderToSeparateWindowChanged);
onRenderToSeparateWindowChanged();

View File

@ -348,7 +348,7 @@ void PostProcessingShaderConfigWidget::createUi()
QCheckBox* checkbox = new QCheckBox(QString::fromStdString(option.ui_name), this);
checkbox->setToolTip(tooltip);
checkbox->setChecked(option.value[0].int_value != 0);
connect(checkbox, &QCheckBox::stateChanged, [this, &option](int state) {
connect(checkbox, &QCheckBox::checkStateChanged, [this, &option](Qt::CheckState state) {
option.value[0].int_value = (state == Qt::Checked) ? 1 : 0;
updateConfigForOption(option);
});

View File

@ -180,11 +180,7 @@ static constexpr KeyCodeName s_qt_key_names[] = {{Qt::Key_Escape, "Escape", ICON
{Qt::Key_twosuperior, "twosuperior", nullptr},
{Qt::Key_threesuperior, "threesuperior", nullptr},
{Qt::Key_acute, "acute", nullptr},
#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0))
{Qt::Key_micro, "micro", nullptr},
#else
{Qt::Key_mu, "mu", nullptr},
#endif
{Qt::Key_paragraph, "paragraph", nullptr},
{Qt::Key_periodcentered, "periodcentered", nullptr},
{Qt::Key_cedilla, "cedilla", nullptr},

View File

@ -265,7 +265,7 @@ struct SettingAccessor<QCheckBox>
template<typename F>
static void connectValueChanged(QCheckBox* widget, F func)
{
widget->connect(widget, &QCheckBox::stateChanged, func);
widget->connect(widget, &QCheckBox::checkStateChanged, func);
}
};

View File

@ -328,7 +328,7 @@ void SetupWizardDialog::addPathToTable(const std::string& path, bool recursive)
m_ui.searchDirectoryList->setCellWidget(row, 1, cb);
cb->setChecked(recursive);
connect(cb, &QCheckBox::stateChanged, [item](int state) {
connect(cb, &QCheckBox::checkStateChanged, [item](Qt::CheckState state) {
const std::string path(item->text().toStdString());
if (state == Qt::Checked)
{