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

Support building QGIS application on Qt 6 #243

Open
nyalldawson opened this issue Jan 20, 2022 · 15 comments
Open

Support building QGIS application on Qt 6 #243

nyalldawson opened this issue Jan 20, 2022 · 15 comments

Comments

@nyalldawson
Copy link
Contributor

QGIS Enhancement: Support building QGIS app on Qt 6

Date 2022/01/20

Author Nyall Dawson (@nyalldawson)

Contact nyall dot dawson at gmail dot com

Version <= QGIS 3.28

Summary

QGIS is heavily dependent on the Qt library. Almost every part of QGIS utilises the Qt library!

Currently, QGIS builds are only supported on version 5 of the Qt libraries. Upstream Qt library maintainers have effectively end-of-life'd Qt 5, and only support the newer Qt 6 version.

Some work was done on a voluntary basis during 2021 to allow QGIS to build under the Qt6 library. This voluntary work added support for building the "core" and "analysis" components of QGIS. Support was added to QGIS' CI (continous integration) testing suite on github so that every pull request triggers a build of the core and analysis libraries on Qt 6, preventing any new work from breaking compatibility with Qt 6. Additionally, a number of the existing core and analysis unit tests are also run on the Qt 6 builds. These tests account for roughly 1/3 of the core/analysis unit tests -- the rest are failing under Qt 6 only for reasons currently unknown.

Remaining components which currently cannot be built on Qt6 are the "gui", "app", "3d" and "server" components. This grant proposal covers porting the "gui" and "app" components to Qt6 compatibility, which is the minimum subset of QGIS required to allow the QGIS application to run and be user testable. (The "server", "3d" and python components of QGIS will not be targeted in this project)

(Note that for the foreseeable future QGIS will only be officially supported under the Qt5 environment. This work is being undertaken to prepare QGIS for future officially supported Qt6 builds.)

Importance of work

As noted above, upstream Qt maintainers have declared Qt 5 as "end of life". We no longer receive bug fixes or security fixes for Qt 5, and this directly affects the quality and stability of QGIS itself. Bugs in the Qt library directly affect QGIS, and by restricting QGIS to version of Qt which is no longer supported we have no official means of addressing these issues.

As a result, it is critical that QGIS is prepared for an eventual transition to Qt 6.

Scope of work

This grant project includes the following concrete deliverables:

  • Adding support for Qt6 builds of the "GUI" library, including building the associated gui unit tests
  • Adding support for Qt6 builds of the "app" library, including building the associated app unit tests
  • Extending the current Qt6 tests on the github CI (continuous integration testing environment) so that the gui and app libraries are automatically built for all pull requests submitted to QGIS, and all gui/app unit tests which work without changes are also enabled on this CI

The grant project has been costed to allow for 2 weeks developer focus on the Qt 6 builds. Assuming that the above deliverables can be implemented with time remaining, all remaining time will be devoted to tracking down the source of test failures which are occurring only on the Qt 6 builds.

Issue Tracking ID(s)

N/A

Votes

(required)

@pcav
Copy link
Member

pcav commented Jan 20, 2022

+1, thanks

@3nids
Copy link
Member

3nids commented Feb 8, 2022

Do you have any plan regarding QtWebkit?

@nyalldawson
Copy link
Contributor Author

@3nids

Do you have any plan regarding QtWebkit?

Leaving it disabled for now.

@viisautta
Copy link

Thx a lot.

@selimnairb
Copy link

Is there an "easy" way for people to get started helping with this port? I don't see an issue that summarizes/coordinates the outstanding work on the port. Is there a branch where work is being done (I briefly looked, but didn't find one).

@nyalldawson
Copy link
Contributor Author

@selimnairb

Everything is in the master branch (and the vast majority was in the 3.28 release), so building either of those should give good results on qt6

@MCA4213
Copy link

MCA4213 commented Nov 1, 2022

Hi, I have noticed that qgis native for windows didn't change (winExtras still in code), so it is not possible to build qgis gui till now.

Do you have any time plan on when this can be done?

Thank you so much.

@zackarno
Copy link

zackarno commented Feb 9, 2023

Wondering if there are any instructions on how to build with Qt 6 or if this is even possible/recommended? I'm using Q 3.28.2.

Thanks you very much!

@DavidDohmen
Copy link

DavidDohmen commented Nov 8, 2023

I wonder if the Linux Wayland issues are related to the Qt5 base, so probably quality of life could largely improved by using to Qt6.
We're willing of financially contributing to this support, if it improves the Wayland situation. Can someone explain the "Grant 2022" tag to me? Is it related to supporting specific features like this one?

@eflaten
Copy link

eflaten commented Nov 14, 2023

Do we now if QGIS will be built on QT6 anytime soon?

@AndroAndrei
Copy link

Hi friends!, is qgis_gui linking with Qt6 in Qgis 3.34 Prizren?

@troopa81
Copy link

Hi friends!, is qgis_gui linking with Qt6 in Qgis 3.34 Prizren?

No, QGIS 3.34 is still building upon Qt5

Do we now if QGIS will be built on QT6 anytime soon?

It's possible to build QGIS with Qt6, but without Python binding for now. It would be soon possible but there would be still work to be done in order to have a fully QGIS working version with Qt6.

@kannes
Copy link

kannes commented Sep 11, 2024

For everyone looking here for up to date QGIS with Qt6 infos: Python works! :)

image


Notes from my compiling

On Manjaro I could compile fine with by installing qwt-qt6 and setting these options with ccmake:

BUILD_WITH_QT6                  ON
QWT_INCLUDE_DIR                  /usr/include/qwt-qt6
QWT_LIBRARY                      /usr/lib/libqwt-qt6.so

Of course you might be missing other dependencies.

I also disabled a lot of things.

@XavierCLL
Copy link

@kannes sounds great have a functional Qgis+Qt6 in Linux! could you please share the PKGBUILD?

@kannes
Copy link

kannes commented Sep 17, 2024

@kannes sounds great have a functional Qgis+Qt6 in Linux! could you please share the PKGBUILD?

Sorry but I did not bother writing one. If you install the packages needed for qgis-git adjusted to Qt6 and add/change the appropriate build options, you should get far.

Also as I said, I disabled a lot of things (pretty everything I did not need for the tests I wanted to do). So I am not sure what might not yet work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests