Qt6 tracking thread

I wanted to have a thread where we could specifically track and discuss the progress on switching to Qt6, so here we are. This way we have somewhere to list build problems, outstanding blocking issues etc.

I’ve tried to collect together references to known things that need to be done, it would be great if people can leave comments with additions and corrections.

Previous work and discussion

Build status

  • Linux
    • Binary builds successfully
    • AppImage builds successfully via GitHub actions
    • Flatpak builds successfully
  • Windows
    • x86
    • ARM
  • Mac
    • x86
    • ARM
    • Universal

Known issues

(and users who observed/reported/experienced said issue)

  • @matterhorn103 According to terminal output, only formatScripts are checked for, not energy, commands, inputGenerators, or charges scripts
  • @matterhorn103 No menu options for inserting molecules/crystals (presumably both this and the above are to do with Python)

To Do

  • Include Qt:Core5Compat where needed
  • Port QRegExp to QRegularExpression
  • Investigate compilation on ARM Windows when Qt 6.8 is released (3rd October) – @matterhorn103 has a machine to do this on
  • Get the GitHub actions bot to return the Qt6 binaries from the automated tests so that people can test them out on their hardware
  • Change release script/config so that Qt6 builds are included, or take the place of the Qt5 ones
1 Like

It has to be said, a remarkable amount seems to work fine.

@ghutchis I’m keen to work on the remaining stuff where I can and help to push this through, so would be especially good to hear from you what the “easy but tediously time-consuming” things are, because that’s exactly the sort of thing I can take care of. :slight_smile:

As a first thing I’ll try and get the regex stuff moved over, that’s eminently doable for me.

@brockdyer03 Once you’ve got Avogadro successfully compiling on Windows, would you mind giving a build with Qt6 a go sometime? I no longer have admin rights to any x86 Windows machines, sadly.

1 Like

If we get everything moved over to Qt6 as far as compiles, I will happily investigate getting binaries “shipped.”

The main pain point is moving to the new Qt6 deployment mechanism, but it’s a solvable problem.

Is that something I can look at and put time into helping with?

You’ve mentioned the deployment thing before, but I’ve never really understood what the deploy script is, what it does that the CMake files + the GitHub actions don’t already do, and where the current script can be found in the repo.

Having read Qt's CMake deployment API, I guess what you are talking about is running qt_generate_deploy_app_script within the main CMakeLists.txt file?

I guess the key to my lack of understanding is that I don’t understand what system/process is currently handling the things that the Qt6 deployment tools would take over – some brief enlightenment would be much appreciated.

There are various pieces in avogadroapp including cmake/DeployQt5.cmake, avogadro/CMakeLists.txt and avogadro/lastinstall/CMakeLists.txt that fix up the bundles.

The main point is to take bits in the build prefix directory, and put the necessary binaries, libraries, etc. together, setting relative paths, etc. On Mac, this is a bit complicated, since binaries and libraries default to tracking the absolute paths of their dependencies.

1 Like

As an update on progress, everything should be pretty much there now. This PR ports all the QRegExp stuff and reenables the plugin stuff that was being excluded; this solves both the mentioned “known issues”, and all the scripts, fragments, and crystals stuff works.

Part of the merge request is also a change to the GitHub Actions workflows so that Qt6 binaries are uploaded for testing. Hopefully then Windows people can help out with checking for issues.

1 Like

For people interested on compiling against Qt6 themselves, the main things to note are:

  1. You will need the QtOpenGL and QtOpenGLWidgets libraries in addition to the usual ones
  2. You need to build with the cmake flags -DQT_VERSION=6 -DBUILD_MOLEQUEUE=OFF (though the latter shouldn’t be necessary, it should be the default, but it is worth making sure)

Now that Qt 6.8 is out, I did also briefly check out building on Windows ARM as I mentioned in the original post. I’ll write in more detail about that either here or in this old thread at some point. Even though full Qt support is now there, the prospects of Avogadro on the platform sadly aren’t looking promising due to issues related to OpenGL support on WinARM.

Is there a way to bundle the OpenGL Compatibility Pack with the installer?

Actually, the point I got stuck on was that the Qt libraries that Qt have made available to download simply don’t include QtOpenGL and QtOpenGLWidgets in the ARM version.

Presumably it would be possible to compile Qt with those libraries myself, but I haven’t looked at that yet. Would compiling Qt ourselves even be a viable option for distribution?

Yeah, I installed this too as one of things I did to try and help (it’s available from the MS store, for any future readers). I assume it would be essential to run the program. But no, I haven’t looked into that possibility. It’s something like 200 MB.

Also only up to OpenGL 3.3 is explicitly supported, though “OpenGL apps using versions up to 4.6 may work as well.”

Yeah. I looked at it with Qt5 and a universal build for Mac. We could certainly have a separate action that builds Qt (e.g. one a week or so) and provides the binaries to the current code.

Yeah, as part of the port to the core profile / OpenGL 4 this summer, I think we’ll need to have some conditional code anyway. Mac only supports up to 4.1, and some features (e.g. compute shaders) would be really nice when available.

1 Like

This looks far enough along, I’ll switch my laptop to test out the Qt6 version. This will hopefully give me some incentive to fixup the deploy scripts. My guess is if I can get the Mac version, the Windows and AppImage versions should be similar.

1 Like

So good news from that front – I built the Qt 6.8 version on my laptop and there’s already a prefix/Avogadro2.app which runs correctly. I’ll check out various features over the next few days, but it looks promising.

1 Like

As a small update, the new beta flatpak builds successfully against Qt 6.7 (the current default KDE SDK). :grin:

Have you indeed been using Qt 6 for your recent development work? If so, how’s it been going?