Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: fix deprecation warnings #1672

Merged
merged 1 commit into from
Dec 31, 2024
Merged

Qt: fix deprecation warnings #1672

merged 1 commit into from
Dec 31, 2024

Conversation

oltolm
Copy link
Contributor

@oltolm oltolm commented Dec 5, 2024

No description provided.

@C0rn3j
Copy link
Contributor

C0rn3j commented Dec 9, 2024

Modern Qt without this PR:

/build/shadps4-git/src/shadps4/src/qt_gui/settings_dialog.cpp:133:53: warning: ‘void QCheckBox::stateChanged(int)’ is deprecated: Use checkStateChanged() instead [-Wdeprecated-declarations]
  133 |         connect(ui->fullscreenCheckBox, &QCheckBox::stateChanged, this,

EOL Qt with this PR:

/home/runner/work/shadPS4/shadPS4/src/qt_gui/settings_dialog.cpp:273:47: error: no member named 'checkStateChanged' in 'QCheckBox'
  273 |         connect(ui->rdocCheckBox, &QCheckBox::checkStateChanged, this,

checkStateChanged() is only present in Qt 6.7 and up.

stateChanged() will be last present in Qt 6.9 (or removed in 6.9, I can't parse what "until 6.9" means) - releasing in about 3 months - Final 18.03.2025.

https://doc.qt.io/qt-6/qcheckbox.html#signals

Noble, which the current build system depends on, uses Qt 6.4.

6.4 has been EOL since 2023-03-31.

Switching the CI to Ubuntu 24.10 (Oracular) won't help, as while it does ship newer Qt, it's still an old EOL version without support at 6.6

25.04 (which should release 2025-05-xx) should work fine, but that's 5 months away, though I don't really see an alternative unless you want to somehow ifdef it for different Qt versions (is that even doable?).

TL;DR this either has to:

  • wait a very long time
  • build system needs large changes
  • (ideal if possible) ifdef for qt versions needs to be added

EDIT: Conflicts after 3f1061d

@oltolm
Copy link
Contributor Author

oltolm commented Dec 20, 2024

I updated it.

@Hermiten
Copy link
Collaborator

Is it still up to date?

@C0rn3j
Copy link
Contributor

C0rn3j commented Dec 28, 2024

Looks like it, but it also still misses any Qt version check ifdefs, as per my previous message, so can't be pulled as is.

@oltolm oltolm force-pushed the qt6 branch 2 times, most recently from d493df0 to 6c7d197 Compare December 31, 2024 16:09
@oltolm
Copy link
Contributor Author

oltolm commented Dec 31, 2024

I added ifdefs.

@@ -254,7 +253,11 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
connect(noButton, &QPushButton::clicked, this, [this]() { close(); });

autoUpdateCheckBox->setChecked(Config::autoUpdate());
#if (QT_VERSION < QT_VERSION_CHECK(6, 8, 0))
Copy link
Contributor

@C0rn3j C0rn3j Dec 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these two checks be <6.7.0?

https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/6.7.0/release-note.md

5a96d13bb5 QCheckBox: add new checkStateChanged(Qt::CheckState) signal
Added new checkStateChanged(Qt::CheckState) signal, obsoleting stateChanged(int).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -130,8 +130,13 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
// GENERAL TAB
{
#ifdef ENABLE_UPDATER
#if (QT_VERSION < QT_VERSION_CHECK(6, 8, 0))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@georgemoralis georgemoralis merged commit 65cd3be into shadps4-emu:main Dec 31, 2024
10 checks passed
@oltolm oltolm deleted the qt6 branch December 31, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants