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

Plan the Qt6 migration #1198

Open
lmoureaux opened this issue Aug 6, 2022 · 5 comments
Open

Plan the Qt6 migration #1198

lmoureaux opened this issue Aug 6, 2022 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@lmoureaux
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Freeciv21 currently uses Qt5, which is EOL. We'll need to migrate to Qt6 at some point, this issue is for planning the migration.

Describe the solution you'd like

A typical migration would take place in steps:

  • Remove support for Qt versions < 5.15
  • Remove constructs deprecated in 5.15 (e.g. the infamous QString::SkipEmptyParts)
  • Add the option to build with Qt6
  • Fix Qt6 issues that don't break the Qt5 build
  • Fix the remainder issues and remove Qt5 support (this should be as short as possible because everything is broken during that step)

The whole cycle can span several releases. This is not for 3.0, but we should decide when to start.

Additional context

Distro availability of Qt is finally increasing with Ubuntu 22.04 and Debian backports catching up.
Our KArchive dependency already builds in Qt6, but the Qt6 version is not shipped in distros. We may need to vendor it for a while.

@lmoureaux lmoureaux added enhancement New feature or request question Further information is requested labels Aug 6, 2022
@jwrober
Copy link
Collaborator

jwrober commented Sep 2, 2022

As of 8/13/22 Ubuntu and its variants are up to 22.04.1 and those with 20.04.x can do in place upgrades. Ubuntu 22.04.x has Qt 5.15 LTS. When we tag stable 3.0 I think we can do the first step of removing support for Qt version < 5.15.

lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 13, 2022
We haven't been testing lower versions for months now (since the release of
Ubuntu 22.04).

See longturn#1198.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 13, 2022
The Sphinx documentation already said 5.15.

See longturn#1198.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 13, 2022
Use Qt::SkipEmptyParts instead.

See longturn#1198.
Closes longturn#1073.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 13, 2022
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 13, 2022
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 13, 2022
The function was removed without replacement, but it was mainly returning (0,
0) anyway.

See longturn#1198.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 13, 2022
The function returning a pointer was deprecated in Qt 5.15.

See longturn#1198.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 13, 2022
The Qt version in Ubuntu 20.04 (5.12) is too old, and I don't want to figure
out how to enable backports.

See longturn#1198.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 1, 2023
We haven't been testing lower versions for months now (since the release of
Ubuntu 22.04).

See longturn#1198.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 1, 2023
The Sphinx documentation already said 5.15.

See longturn#1198.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 1, 2023
Use Qt::SkipEmptyParts instead.

See longturn#1198.
Closes longturn#1073.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 1, 2023
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 1, 2023
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 1, 2023
The function was removed without replacement, but it was mainly returning (0,
0) anyway.

See longturn#1198.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 1, 2023
The function returning a pointer was deprecated in Qt 5.15.

See longturn#1198.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Jan 1, 2023
The Qt version in Ubuntu 20.04 (5.12) is too old, and I don't want to figure
out how to enable backports.

See longturn#1198.
lmoureaux added a commit that referenced this issue Jan 1, 2023
We haven't been testing lower versions for months now (since the release of
Ubuntu 22.04).

See #1198.
lmoureaux added a commit that referenced this issue Jan 1, 2023
The Sphinx documentation already said 5.15.

See #1198.
lmoureaux added a commit that referenced this issue Jan 1, 2023
Use Qt::SkipEmptyParts instead.

See #1198.
Closes #1073.
lmoureaux added a commit that referenced this issue Jan 1, 2023
lmoureaux added a commit that referenced this issue Jan 1, 2023
lmoureaux added a commit that referenced this issue Jan 1, 2023
The function was removed without replacement, but it was mainly returning (0,
0) anyway.

See #1198.
lmoureaux added a commit that referenced this issue Jan 1, 2023
The function returning a pointer was deprecated in Qt 5.15.

See #1198.
lmoureaux added a commit that referenced this issue Jan 1, 2023
The Qt version in Ubuntu 20.04 (5.12) is too old, and I don't want to figure
out how to enable backports.

See #1198.
@lmoureaux
Copy link
Contributor Author

It would be good to have KF6 for a native Qt6 KArchive. There was a progress report today.

@lmoureaux
Copy link
Contributor Author

Relevant blog post: https://rabbitictranslator.com/port-to-qt6/

@lmoureaux
Copy link
Contributor Author

lmoureaux commented Dec 15, 2023

We'll need to bump the targeted macOS version in the CI since Qt6 needs at least macOS 11. Qt6 needs Windows 10, but we don't have an explicit version requirement anywhere I can think of.

@lmoureaux
Copy link
Contributor Author

lmoureaux commented Mar 17, 2024

Tried a first build with Qt 6. Non exhaustive list of changes needed for Qt6:

  • QTextCodec removed, port to QStringConverter after merging Refactor encodings #2145. The replacement of QTextCodec::setCodecForLocale is unclear
  • KFilterDev renamed (?) to KCompressionDevice
  • QVector forward declaration changed, now QVector is the same as QList
  • QString::leftRef removed, port to QString::left (?)
  • QStandardPaths::DataLocation renamed to QStandardPath::AppDataLocation
  • uic-generated code fails to connect to QLabel::setNum for governor_widget.ui because it's an overloaded function. This is a Qt bug but there's little chance to see it fixed in the near future (it's been pending for 3 years in "critical" priority)
  • QStyleOption::init -> QStyleOption::initFrom

lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Mar 17, 2024
This changes the CMake code to build Freeciv21 against Qt 6 and Kde
Frameworks 6.

See longturn#1198.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants