[Qgis-psc] Current state of QGIS and Qt 6 (good news!)

Nyall Dawson nyall.dawson at gmail.com
Wed Aug 17 21:46:41 PDT 2022


Hi list,

There's been a couple of questions regarding this lately, so I'd like
to send through an update on the current status. While I was rather
pessimistic when replying to these questions, I'm happy to report that
the port to Qt 6 is actually progressing MUCH faster than I'd
anticipated!

Thanks to the QGIS.org grant, I've spent the last couple of weeks
working on this and we're now at a stage where QGIS builds and is
(mostly) usable on Qt 6!!

Right now this is where we're stand:

- The core, gui and app libraries all build and run under Qt 6.
- The 3d library builds and the tests all pass, but I just get a hang
when I try to actually use a 3d view in the app
- There's an open PR adding Qt 6 support for server (
https://github.com/qgis/QGIS/pull/49823 )
- Python is not supported, there's some blockers there to resolve first*
- Almost all the c++ tests are passing, and there's a bunch of open
PRs which resolve some issues to get a few more passing
- The CI infrastructure now includes the c++ tests for QGIS core, gui,
app and 3d under Qt 6 (with server tests enabled in the PR waiting
review).

Unfortunately without Python support we can't run the bulk of the test
suite yet, so the current stability of the Qt 6 builds is a bit of an
unknown. At least in my tests things *seem* to work well, in that I
can load projects, navigate maps, work with print layouts and other
common tasks. I certainly wouldn't recommend it for any kind of
professional use, but it's at a stage where I'd welcome end-user
testing and bug reports!

Getting a build is somewhat tricky at the moment. I've been using
Fedora 36 for this. You can get the required dependencies from this
command: https://github.com/qgis/QGIS/blob/master/.docker/qgis3-qt6-build-deps.dockerfile#L6

You also need to compile by hand:
- qca, from https://github.com/KDE/qca/archive/refs/heads/master.zip
(make sure to set the -DQT6=ON cmake flag)
- qtkeychain, from
https://github.com/frankosterfeld/qtkeychain/archive/refs/heads/master.zip
. Set the -DBUILD_WITH_QT6=ON cmake flag
- qwt-6.2 from https://sourceforge.net/projects/qwt/files/qwt/6.2.0/qwt-6.2.0.zip/download
. This is an ugly one to compile -- you need to use qmake6 and hack
around some random build failures
- QScintilla 2.13.3 from
https://www.riverbankcomputing.com/static/Downloads/QScintilla/2.13.3/QScintilla_src-2.13.3.zip
. Again, use qmake6 to compile to get the qt 6 libraries.

(there's potentially some useful tips on compiling these in the docker
file used for the Github workflow at
https://github.com/qgis/QGIS/blob/master/.docker/qgis3-qt6-build-deps.dockerfile
)

When you're building QGIS, make sure to set the cmake options
-DBUILD_WITH_QT6=ON -DWITH_BINDINGS=OFF . Likely you also need to set
QCA_INCLUDE_DIR, QCA_LIBRARY, QSCINTILLA_INCLUDE_DIR,
QSCINTILLA_LIBRARY, QTKEYCHAIN_INCLUDE_DIR, QTKEYCHAIN_LIBRARY,
QWT_INCLUDE_DIR and QWT_LIBRARY to point to the correct Qt 6 versions
of these libraries.

Nyall

* regarding Python support: Currently Fedora doesn't have packages for
PyQt6, which prevents enabling the Python bindings on Qt 6 builds.
There's an open request for packaging this but no movement yet. I'd
suggest that potentially QGIS.org could sponsor Sandro Mani to do this
packaging (also Qt 6 packages for the qca/keychain/qscintilla/qwt
libraries), given his experience in packaging all the other geo
libraries under Fedora...

While there's been discussion and research into potentially moving to
Python for Qt instead of PyQt, that's a longer-term project and can't
be completed until QGIS 4.0. So for our short/medium term requirements
we need PyQt6 to move forward with the remaining Qt6 work...


More information about the Qgis-psc mailing list