vkbo / novelWriter

novelWriter is an open source plain text editor designed for writing novels. It supports a minimal markdown-like syntax for formatting text. It is written with Python 3 (3.9+) and Qt 5 (5.15) for cross-platform support.
https://novelwriter.io
GNU General Public License v3.0
2.06k stars 106 forks source link

Move to Qt6 #1142

Open vkbo opened 2 years ago

vkbo commented 2 years ago

Qt6 has been out for a while now, and PyQt6 has as well. There are some minor benefits to moving to Qt6, but it is far too early to drop support for Qt5. It should be possible to support both, like was frequently done when Qt went from 4 to 5.

It is not urgent, but starting to cap off older versions of Qt5 may be useful. Some of the infrastructure novelWriter relies on don't support versions older than 5.11.

Depends on #1473

vkbo commented 2 years ago

This should wait until PyQt6 is available in Debian. Either on the next major release of Debian Bookworm, or in the Bullseye backports. Currently, it's only available in testing and unstable.

See: https://tracker.debian.org/pkg/pyqt6

longqzh commented 1 year ago

I recommend to use abstraction layer for PyQt5/PySide2/PyQt6/PySide6 qtpy which is deleveped by spider-ide. It may make the migration smoothly

vkbo commented 1 year ago

I don't want to pull in any new dependencies. I'm trying to get rid of as many as possible.

I don't expect the transition from PyQt5 to PyQt6 to be particularly difficult, and I don't plan to add support for both PyQt and PySide. Although I have considered switching to PySide entirely now that Qt maintains it.

vkbo commented 1 year ago

Due to Qt 5.15 having reached end of life in May this year, and there are issues with Wayland and Qt 5, see #1536, I would like to just move to Qt 6 and discontinue Qt 5 support. I propose to do this for release 2.3.

Since most release formats of novelWriter bundle dependencies, I don't see much of an issue switching. The only releases that depend on system packages are the Debian and Ubuntu .deb releases, and Qt 6 + PyQt 6 have been available there for some time now. This may break compatibility with older Ubuntu releases, but that's not enough of an issue to block moving forward.

xahodo commented 10 months ago

Does Qt6 fix the bugs regarding the scrolling while dragging in a tree view? If so, perhaps it would be helpful to give the move to PyQt6 some more urgency as that would allow for the removal of some workaround code (note: not a coder here, but I remember you needing to implement a workaround in order to achieve the desired behavior).

vkbo commented 10 months ago

I don't know when or if they've fixed the drag and drop bugs. I've identified several issues, so I am likely to keep my workarounds in place anyway since they keep breaking stuff and taking years to fix it.

xahodo commented 7 months ago

Would it be an idea to implement this switch with version 2.5?

According to this support for Qt 5.15 has ended in May 2023, except for those who pay.

vkbo commented 7 months ago

I'm aware. I pointed this out a few comments up. The reason I haven't switched yet is that it will break compatibility with all current Ubuntu LTS releases. I will at least wait until after Ubuntu 24.04 LTS is released, and ideally 24.04.1 which usually comes in July. This is why Qt6 was removed from the 2.4 release milestone. 2.4 is getting close to being ready for beta release.