Let me publish here a text from Michael Weghorn's letter to our dev mailing list about current Qt6 plugin for Windows build status (because I like when more people can see such important information):
Earlier this year, initial support for the qt6 vcl plugin on Windows (and macOS) was implemented on master.
Below is a summary of the current status and potential next steps from my perspective.
I haven't used/tested it much myself beyond the point of "It starts and looks plausible at first" when contributing to it in the past and it is not my own main focus now. The below is meant as a basis for further discussion and coordinating efforts between those who are interested in getting involved to further improve it.
If you have any thoughts or are interested in getting involve, feedback is very welcome!
I think in particularly steps described in "Identify and address what else is missing" could be a good starting point for both, developers (already now, requires building from source), and non-developers (in
particular once tests builds for Windows including the qt6 vcl plugin are provided).
LibreOffice: qt6 vcl plugin on Windows
Background/Motivation
So-called "vcl plugins" are used in LibreOffice to implement the user interface and platform-specific aspects. They can either make use of third-party GUI toolkits or implement the low-level logic themselves.
The Qt-based vcl plugins that use the Qt UI toolkit were originally only used on Linux and similar Unix-based systems. qt5/qt6 was later also selected as the basis for the newly introduced WebAssembly port.
Reusing/Suppporting the qt6 vcl plugin on more platforms could be a potential approach to
- let an existing cross-platform UI toolkit take care of more platform-specific logic instead of "reinventing the wheel"
- unify and share more code across different platforms, also to reduce the maintenance effort
- reduce (but not eliminate) the need for Windows-specific code/knowledge
- ensure reliability and continued development/progress of the user interface (and more) on Windows despite most developers (currently) not working on Windows or Windows-specific code
- allow to make use of capabilities that Qt provides to allow theming/styling of the application
- get support for the newer UIA (User Interface Automation) accessibility protocol on Windows via Qt's internal accessibility bridge
- gain support for "native widgets" if combined with the "Qt welding" task (https://bugs.documentfoundation.org/show_bug.cgi?id=130857)
Since there is no real "standard native UI toolkit" on Windows (see e.g. also the discussion in
https://bugs.documentfoundation.org/show_bug.cgi?id=164656), no clear alternative candidate seems to be available to implement support for "native widgets" on Windows.
Current status
The qt6 vcl plugin code and related code was refactored to also allow building the qt6 vcl plugin on Windows and macOS.
Commit enabling build support on Windows:
https://git.libreoffice.org/core/commit/4d3a291b5d2d8a2dbdae5aca0d5fd506b5d5b0b9
Commit enabling build support on macOS:
https://git.libreoffice.org/core/commit/ddfc4058cfff09454621fe68f8804bbf289558b5
This work was inspired by/based on an earlier WIP branch ("feature/qt5-win+mac") by Jan-Marek Glogowski for adding Windows and macOS support for the qt5 vcl plugin.
The qt6 vcl plugin on Windows and macOS is still experimental and more work is required to reach parity with the existing vcl plugin implementations so far used on those platforms. Known aspects/Potential steps are listed in the following section.
Aspects/Potential next steps
Fix the `--enable-headless` build on Windows
qt6 currently supports two rendering backends:
- Cairo, currently the more mature implementation, available and used by default when building with the --enable-headless autogen option
- QFont (native Qt rendering), which can explicitly be enabled by setting environment variable SAL_VCL_QT_USE_QFONT=1
While Cairo was available when initial Windows support was merged to master, the --enable-headless build on Windows broke later with a fontconfig update.
Fixing this again (and probably adding the --enable-headless switch for the Windows CI build to ensure it keeps working) would allow using the more mature rendering path again.
Earlier (WIP/unfinished) attempt: https://gerrit.libreoffice.org/c/core/+/208707
Bundle the required Qt modules as "proper" externals
Currently, a preinstalled Qt is required to build and run LibreOffice with the qt6 vcl plugin. This should be streamlined to use the standard approach to external libraries, which is to (optionally) build them as part of the LibreOffice build and include them in the installation set. This is particularly relevant for Windows. (On Linux, there is a more standard approach to installing and using system-wide libraries.)
Using a system-provided Qt should still remain an option, though, and is particularly relevant e.g. for Linux distributions.
Relevant Qt modules: qtbase, qtmultimedia, qtwayland (only Linux)
Accessibility
The accessibility implementation for the qt6 vcl plugin is not complete yet. (On Linux, the gtk3 vcl plugin currently is the most mature in this regard.)
Besides implementing the LibreOffice-specific parts internally, this will probably also require contributing to upstream Qt in order to extend the API (e.g. to support hyperlinks on the accessibility layer) and improve Qt's internal UIA accessibility bridge.
LibreOffice's custom accessibility bridge implements the IAccessible2 protocol. Qt implements the newer UIA protocol. Using the qt6 vcl plugin therefore implies a switch from IAccessible2 to UIA.
Some assistive technology implements LibreOffice-specific logic to optimize the experience when using LibreOffice. In cases where that relies on the current IAccessible2 implementation, assistive technology will also have to be adjusted to work with the Qt-based LibreOffice variant. One example is NVDA's soffice app module.
Qt Style
Some people say that the default style that Qt ships for Windows isn't particularly nice/appealing.
The KDE project for example bundles its Breeze style with the Windows builds of its applications.
It should be considered which Qt style to use by default for LibreOffice when using the qt6 vcl plugin (and to package that one, as needed).
Related ticket: https://bugs.documentfoundation.org/show_bug.cgi?id=172885 (Find a
common Qt theme/style for all platforms)
Identify and address what else is missing
This step is about identifying and addressing any other remaining aspects that are still missing.
Potential steps:
- implement support for screen saver and power management inhibition during presentations
- see QtFrame::StartPresentation
- either just reuse the existing platform-specific logic implemented in the current "win" vcl plugin or use the opportunity to introduce corresponding cross-platform API upstream in Qt (see https://qt-project.atlassian.net/browse/QTBUG-89477)
- check whether input method handling (IM) works as expected
- get over the current "win" vcl plugin implementation and check what it implements that the qt6 version on Windows doesn't yet
- get over the kf5 and qt6 meta bugs and identify what is particularly relevant for the Windows version:
- https://bugs.documentfoundation.org/show_bug.cgi?id=102495 ([META] KDE (kf5) VCL backend bugs and enhancements")
- This was used for qt5 as well. Retesting with qt6 and adding to the following meta bug could also make sense.
- https://bugs.documentfoundation.org/show_bug.cgi?id=145734 ([META] Qt6/KF6 VCL plugin bugs and enhancements)
- in particular https://bugs.documentfoundation.org/show_bug.cgi?id=172875 sounds pretty serious, but wasn't reproducible so far
- (encourage) testing and handle issues that get found
Provide qt6 Windows build for testing
In order to allow testing and feedback by a wider audience, providing a Windows build of LibreOffice with the qt6 vcl plugin enabled can be very useful. Enabling the qt6 vcl plugin for the daily builds might be a potential approach.
Depends on the first two items listed above (fontconfig build fix, bundling Qt modules as externals) to be able to provide a (more) useful build for testing.
Optional: Use of native Qt widgets (Qt welding)
Using native Qt widgets instead of the custom vcl widgets is expected to eventually improve the overall experience on all platforms when using the qt6 vcl plugin, including Windows. It's not a prerequisite for using qt6 on Windows however in case the vcl-based implementation is considered fine initially.
Related ticket: https://bugs.documentfoundation.org/show_bug.cgi?id=130857 (qt5/qt6:
implement theming using native Qt widgets (weld))