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

Mathieu Pellerin nirvn.asia at gmail.com
Sat Aug 20 03:24:34 PDT 2022


Oh, by the way, we'll need to adapt Find{Qca,QWT,etc}.cmake to behave
nicely on systems where both qt5 and qt6 libraries are installed. Atm it'll
randomly pick one or the other.

We can make use of BUILD_WITH_QT6 there.

On Sat, Aug 20, 2022, 15:22 Mathieu Pellerin <nirvn.asia at gmail.com> wrote:

> Richard,
>
> FYI, I've been able to compile QGIS against Qt6 (6.2.4) on Ubuntu 22.04.
> Few notes:
> - We're lucky, Ubuntu 22.04 has a Qt6 keychain package, you should use
> this one, that reduces the nb of libs to compile to 3
> - As Matthias suggested, I'd install the libraries
> - The QCA_INCLUDE_DIR has to point to the QtCrypto directory (e.g. on my
> machine, I set the installed include path to
> /usr/include/x86_64-linux-gnu/qt6/Qca-qt6/QtCrypto/ -- it might work from
> the directory you built qca within, but I suspect the path would have to be
> something like /home/richard/git/qca/qca-master/include/QtCrypto/)
>
> On the bindings front, while Ubuntu 22.04 doesn't have a pyqt6 package,
> upcoming Ubuntu 22.10 will ship one (
> https://packages.ubuntu.com/kinetic/pyqt6-dev). With a bit of chance,
> Ubuntu will have updated to 6.3.X come October.
>
> Nyall, you rock BTW, it's pretty cool to see QGIS running against Qt6
> locally.
>
> Mathieu
>
> On Thu, Aug 18, 2022 at 4:43 PM Richard Duivenvoorde via QGIS-Developer <
> qgis-developer at lists.osgeo.org> wrote:
>
>> Cool! Thanks Nyall!
>>
>> Off course this is a challenge for Debianista's :-)
>>
>> Just tried on Debian testing, actually your 4 zip's/dependecies compiling
>> went very well.
>> (did not INSTALL anything, just compiled)
>>
>> But then I get stuck on QGIS itself (looks like it is trying to compile
>> the ossl plugin again, or qca is not finding the plugin so?)
>> (note: I disabled some AUTH stuff because... something errored, and I
>> thought to try without)
>>
>> # build QGIS qt6 (had build all other stuff in /home/richard/git/qca)
>> mkdir build
>> cd build
>> ccmake -DBUILD_WITH_QT6=ON -DWITH_BINDINGS=OFF \
>> -DQCA_INCLUDE_DIR=/home/richard/git/qca/qca-master \
>> -DQCA_LIBRARY=/home/richard/git/qca/qca-master/lib/libqca-qt6.so.2.3.4 \
>> -DQSCINTILLA_INCLUDE_DIR=/home/richard/git/qca/QScintilla_src-2.13.3/src/
>> \
>> -DQSCINTILLA_LIBRARY=/home/richard/git/qca/QScintilla_src-2.13.3/src/libqscintilla2_qt6.so.15.1.1
>> \
>> -DQTKEYCHAIN_INCLUDE_DIR=/home/richard/git/qca/qtkeychain-master \
>> -DQTKEYCHAIN_LIBRARY=/home/richard/git/qca/qtkeychain-master/libqt6keychain.so.0.13.99
>> \
>> -DQWT_INCLUDE_DIR=/home/richard/git/qca/qwt-6.2.0/src \
>> -DQWT_LIBRARY=/home/richard/git/qca/qwt-6.2.0/lib/libqwt.so.6.2.0 \
>> -DWITH_OAUTH2_PLUGIN=OFF \
>> -DWITH_AUTH=OFF \
>> ..
>>
>>   QCA OpenSSL plugin C++ check compile output:
>>   Change Dir: /home/richard/git/qgisqt6/build/CMakeFiles/CMakeTmp
>>
>>   Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_c5530/fast &&
>> /usr/bin/gmake  -f CMakeFiles/cmTC_c5530.dir/build.make
>> CMakeFiles/cmTC_c5530.dir/build
>>   gmake[1]: Entering directory
>> '/home/richard/git/qgisqt6/build/CMakeFiles/CMakeTmp'
>>   Building CXX object CMakeFiles/cmTC_c5530.dir/qcaossl.cpp.o
>>   /usr/bin/c++  -I/usr/include/x86_64-linux-gnu/qt5
>> -I/usr/include/x86_64-linux-gnu/qt5/QtCore
>> -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++
>> -I/home/richard/git/qca/qca-master -fPIC  -std=gnu++11 -o
>> CMakeFiles/cmTC_c5530.dir/qcaossl.cpp.o
>>   -c /home/richard/git/qgisqt6/build/CMakeFiles/CMakeTmp/qcaossl.cpp
>>   /home/richard/git/qgisqt6/build/CMakeFiles/CMakeTmp/qcaossl.cpp:2:16:
>> fatal error: QtCrypto: No such file or directory
>>       2 |       #include <QtCrypto>
>>         |                ^~~~~~~~~~
>>   compilation terminated.
>>   gmake[1]: *** [CMakeFiles/cmTC_c5530.dir/build.make:78:
>> CMakeFiles/cmTC_c5530.dir/qcaossl.cpp.o] Error 1
>>   gmake[1]: Leaving directory
>> '/home/richard/git/qgisqt6/build/CMakeFiles/CMakeTmp'
>>   gmake: *** [Makefile:127: cmTC_c5530/fast] Error 2
>>
>>   CMake Error at cmake/QCAMacros.cmake:76 (message):
>>     QCA OpenSSL plugin not found (run-time/unit-test dependency)
>>   Call Stack (most recent call first):
>>     CMakeLists.txt:526 (FIND_QCAOSSL_PLUGIN_CPP)
>>
>>   Configuring incomplete, errors occurred!
>>
>> Anyone a hint?
>>
>> Regards,
>>
>> Richard Duivenvoorde
>>
>>
>> If others want to try, some more notes:
>>
>> # log on Debian Testing dd 18th aug 2022
>>
>> # get all zips from Nyalls qt6 mail:
>>
>> # qca
>> unzip qca-master.zip
>> cd qca-master/
>> # I did
>> ccmake .
>> # and checked BUILD_WITH_QT6=ON
>> # and (after issues with the ossl plugin) set WITH_ossl_PLUGIN=yes
>> make
>>
>> # qtkeychain
>> # unzip and go into dir:
>> # needed to do:
>> unzip qtkeychain-master.zip
>> cd qtkeychain-master/
>> sudo apt install libsecret-1-dev
>> cmake -DBUILD_WITH_QT6=ON .
>> make
>>
>> # qwt-6.2
>> # unzip
>> cd qwt-6.2.0
>> qmake6 -DWITH_PLUGIN=yes qwt.pro
>> make
>>
>> # QScintilla_src-2.13.3
>> cd QScintilla_src-2.13.3
>> cd src
>> qmake6 qscintilla.pro
>> make
>>
>>
>> On 8/18/22 06:46, Nyall Dawson via QGIS-Developer wrote:
>> > 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...
>> > _______________________________________________
>> > QGIS-Developer mailing list
>> > QGIS-Developer at lists.osgeo.org
>> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-psc/attachments/20220820/d1a9fec4/attachment.htm>


More information about the Qgis-psc mailing list