Skip to content

Switching to Qt 6 by default #7202

@The-Compiler

Description

@The-Compiler

(Continuation of #5395 because that was getting rather big)

Current state

On July 22th, 2023, the flip was finally switched to Qt 6 by default. All you need to ensure is what PyQt6 is available, and Qt 6 will be used automatically. If it's not available, you will get a warning shown by qutebrowser.

All information below is considered historical.

The qt6-v2 branch has been merged to master on March 18th, 2023, but with Qt 5 still being the default. See #7628 for details. This issue is now repurposed on what there needs to be done for Qt 6 to be the default Qt wrapper.

The last fixes for the qt6-v2 branch with Qt 6 support went in around May 19th. Multiple core developers (and users) have been using it as a daily driver since far longer (late 2021 / early 2022) and all known crashes are fixed, with all tests passing.

There is still a lot of remaining work, however, on the development side. Due to the big amount of changes (currently 156 commits, 314 files changed, 12,978 additions and 4,094 deletions) it's tricky to integrate this into master without breaking lots of existing open PRs. Thus, we'd like to do another round of PR merging before attempting to do so. The current approach also breaks various tooling, by not properly supporting static analysis (#7128, but that will introduce another big code churn), or by not fixing linting issues yet (#1455).

Bottomline: Feel free to use the qt6-v2 branch, keep in mind it will be rebased from time to time, and it will still take lots of efforts behind the scenes to get it fully integrated.

How to try

mkvenv.py

  • Take a backup of your qutebrowser data directory (see :version) unless you don't mind losing cookies and such when down-/upgrading. This isn't needed if you use --temp-basedir below, but if you forget to do so, your data will get upgraded, and as far as I'm aware, there is no way to read it with Qt 5 after that.
  • Clone the git repo, e.g. via git clone https://github.com/qutebrowser/qutebrowser.git
  • cd qutebrowser
  • Check out the branch using git checkout qt6-v2
  • Create a new separate environment via python3 scripts/mkvenv.py --venv-dir .venv-qt6 --pyqt-version 6.3
  • Set QUTE_QT_WRAPPER=PyQt6 somewhere in the environment
  • Run .venv-qt6/bin/qutebrowser --temp-basedir and verify via :version that you're indeed on Qt 6

Archlinux

qutebrowser-qt6-git is available in the AUR.

Windows / macOS

Built as part of the nightly builds on CI. Click on the most recent passing build, then find the qt6 builds under "Artifacts". Note that you will need to be logged in with a GitHub account to download.

Note for macOS: Due to a PyInstaller issue, Chromium's sandboxing is currently disabled for macOS builds with Qt 6. This means that there will be no additional layer of protection in case of Chromium security bugs. Thus, it's advised to not use this build in production. Hopefully, this situation will be resolved before the final 3.0.0 release.

Flatpak

Published in the flathub-beta repo:

Adding the flathub-beta remote and installing from the beta branch can be done through an application manager (Gnome Software, Discover, ...) or via the command-line.

$ flatpak remote-add --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
$ flatpak install flathub-beta org.qutebrowser.qutebrowser//beta

Remaining issues

TODOs

  • Get macOS builds to work
  • Look at remaining API changes and new features (comment below) moved to Interesting changes in Qt 6.0/.1/.2/.3 #7756
  • Look at remaining FIXME:qt6 comments
  • Make sure qutebrowser has enough feedback (e.g. logging?) about which Qt wrappers it uses and why
  • Maybe investigate storing the Qt wrapper to use in a config file so that we don't unexpectedly switch (and destroy data?) if one is unavailable
  • Decide what to do about test coverage (switch to Qt 6? Combine?)
  • Probably merge some PRs while waiting for more feedback and to avoid crazy conflicts with the next steps moved to v4
  • Integrate Feat/pyqt wrapper bulk import rewrite #7128 if we didn't find a way to make static analysis work otherwise see Type checking and auto-completion with PyQt6 (and PyQt5) #7370 and linked discussion and issue
  • Adopt black (Use auto-formatters (black/isort, maybe autopep8/yapf) #1455) so that we pass "normal" linting again and don't have crazy long lines moved to v4
  • Look at adopting PySide6 again not a priority at the moment
  • Check if we can revert 3c4d51a
  • Potentially start cherry-picking some stuff to master
  • Figure out why our way of blocking back/forward mouse button presses broke
  • Perhaps introduce a Qt 5 warning to get people to switch over

Metadata

Metadata

Assignees

No one assigned

    Labels

    qt: 6Issues related to Qt 6.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions