qt6: Add a qt6 VCL plugin

Desktop / LibreOffice - Michael Weghorn [posteo.de] - 29 September 2021 11:50 UTC

This adds a new "qt6" VCL plugin based on Qt 6.

Building the plugin is enabled by autogen option '--enable-qt6' (and optionally setting 'QT6DIR' as needed).

Use the 'SAL_USE_VCLPLUGIN=qt6' environment variable before running LO to select this VCL plugin.

Taking qt6 into account at all relevant places certainly still requires follow-up changes, but this builds and runs with a self-compiled qtbase from the 'dev' git branch as of commit 3ce0672143d2eb3c3809f82998a4d71c5800d77a. I didn't see anything obviously broken in a quick run, but didn't test much.

This reuses and shares the qt5 VCL plugin code; the qt6 headers and sources for now just '#include' the qt5 ones.

Version checks are used for the code places that need different handling to be built against Qt 6.

The build system parts in this commit were mostly done by copying the qt5 equivalents, then adapting as needed.

Some notes on things I came across while porting to qt6:

1) At least in my self-compiled Qt versions, 'moc' (the meta-object compiler) is located in the 'libexec' subdirectory in 'QT6DIR', while the Qt 5 equivalent is located in the "bin" subdirectory of 'QT5DIR', so the configure.ac check uses the former.

2) moc does not process classes from the included headers. Since the headers in 'vcl/inc/qt6' just '#include' the ones from 'vcl/inc/qt5', running moc on the qt6 headers doesn't work, so moc is currently run on the qt5 headers for qt6 as well (s. 'vcl/CustomTarget_qt6_moc.mk'). That will have to be adapted in case the qt6 VCL plugin uses "own" headers instead of just including the qt5 ones at some point.

3) QX11Extras has been removed from Qt 6. [1] says:

> Changes to Qt X11 Extras > > The QX11Info class has been removed. > > Clients that still rely on the functionality can include the private > header as a stopgap solution. To enable > private headers use QT += core-private with qmake, or add a project > dependency to Qt::CorePrivate with CMake.

I didn't take any closer look, just dropped the use of QtX11Extras for qt6 for now.

4) XCB_ICCCM is no longer needed. It is only used in qt5 to workaround a Qt bug fixed in Qt 5.12, s.

commit fe2baf9e84e0ca9aeaa683e37076f57fa3f38dca Author: Jan-Marek Glogowski Date: Tue Dec 3 08:32:58 2019 +0100

Qt5 fix missing XCB_ICCCM_WM_HINT_WINDOW_GROUP

5) X11-specific code is still used for key modifier handling. Therefore, still check for the XCB headers when 'USING_X11' is set in configure.ac, and use a 'QT6_USING_X11' define (as qt5 uses 'QT5_USING_X11').

6) There's currently no Qt 6 video sink for GStreamer. As of today, qt-gstreamer is unmaintained and there is no Qt 6 version. The project's README [2] says:

> 0. Maintenance Notice > ---------------------> > This code is unmaintained. You can use it at your own risk. > > If you want to integrate video display in your QML-based UI, > you should consider using 'qmlglsink', from gst-plugins-good. > This is a well supported video sink that uses the generic > gstreamer-gl stack and is in many ways superior to 'qtquick2videosink' > that is provided by qt-gstreamer. You can use this code as an example: > https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/qt/qmlsink > > If you are not interested in using QML in your UI, then you > may use one of the other elements provided by this module > (see below). If you do that, it would be helpful to let us > know that this code is still useful to you. We may consider > adding these elements in one of the core gstreamer modules. > > If you are here for the Qt-style bindings, I'm sorry to disappoint you. > The alternative is to use the C API, or the GStreamermm C++ API. > Qt-style bindings are cool, but unfortunately they are very hard > to maintain because they are written by hand. If you are interested > in continuing this project, you are welcome to implement a > generator for them, probably based on GObject-Introspection. > I am happy to provide directions if you want to pursue such a thing.

Therefore, the Qt video sink handling is qt5-only and the corresponding handling for GOBJECT (used for the GStreamer
video sink handling) was not taken over for qt6.

This presumably means that video playback in Impress presentations does not work when using qt6 with they Qt Wayland plugin, s. tdf#125219 for the corresponding bug for qt5/kf5. (I did not build the qtwayland module to actually test this, though.
Video playback with the Qt xcb plugin in a Wayland session works.)

[1] https://doc-snapshots.qt.io/qt6-dev/extras-changes-qt6.html [2] https://cgit.freedesktop.org/gstreamer/qt-gstreamer/tree/README

Change-Id: Ib105ccfb2c3630ec5d5403793a3cd9ba31d85bdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122808

88d57cf24120 qt6: Add a qt6 VCL plugin
Repository.mk | 2 +
RepositoryExternal.mk | 29 ++++++-
config_host.mk.in | 5 ++
config_host/config_vclplug.h.in | 2 +
configure.ac | 136 +++++++++++++++++++++++++++++-
solenv/gbuild/CppunitTest.mk | 1 +
vcl/CustomTarget_qt6_moc.mk | 39 +++++++++
vcl/Library_vcl.mk | 1 +
vcl/Library_vclplug_qt6.mk | 124 +++++++++++++++++++++++++++
vcl/Module_vcl.mk | 13 +++
vcl/inc/qt5/QtFrame.hxx | 7 +-
vcl/inc/qt5/QtTransferable.hxx | 4 +
vcl/inc/qt6/QtAccessibleEventListener.hxx | 12 +++
vcl/inc/qt6/QtAccessibleWidget.hxx | 12 +++
vcl/inc/qt6/QtBitmap.hxx | 12 +++
vcl/inc/qt6/QtClipboard.hxx | 12 +++
vcl/inc/qt6/QtData.hxx | 12 +++
vcl/inc/qt6/QtDragAndDrop.hxx | 12 +++
vcl/inc/qt6/QtFilePicker.hxx | 12 +++
vcl/inc/qt6/QtFont.hxx | 12 +++
vcl/inc/qt6/QtFontFace.hxx | 12 +++
vcl/inc/qt6/QtFrame.hxx | 12 +++
vcl/inc/qt6/QtGraphics.hxx | 12 +++
vcl/inc/qt6/QtGraphicsBase.hxx | 12 +++
vcl/inc/qt6/QtGraphics_Controls.hxx | 12 +++
vcl/inc/qt6/QtInstance.hxx | 12 +++
vcl/inc/qt6/QtMainWindow.hxx | 12 +++
vcl/inc/qt6/QtMenu.hxx | 12 +++
vcl/inc/qt6/QtObject.hxx | 12 +++
vcl/inc/qt6/QtOpenGLContext.hxx | 12 +++
vcl/inc/qt6/QtPainter.hxx | 12 +++
vcl/inc/qt6/QtPrinter.hxx | 12 +++
vcl/inc/qt6/QtSvpGraphics.hxx | 12 +++
vcl/inc/qt6/QtSvpSurface.hxx | 12 +++
vcl/inc/qt6/QtSystem.hxx | 12 +++
vcl/inc/qt6/QtTimer.hxx | 12 +++
vcl/inc/qt6/QtTools.hxx | 12 +++
vcl/inc/qt6/QtTransferable.hxx | 12 +++
vcl/inc/qt6/QtVirtualDevice.hxx | 12 +++
vcl/inc/qt6/QtWidget.hxx | 12 +++
vcl/inc/qt6/QtXAccessible.hxx | 12 +++
vcl/qt5/QtFrame.cxx | 34 +++++---
vcl/qt5/QtInstance.cxx | 9 +-
vcl/qt5/QtMenu.cxx | 6 ++
vcl/qt5/QtTransferable.cxx | 4 +
vcl/qt5/QtWidget.cxx | 6 +-
vcl/qt6/QtAccessibleEventListener.cxx | 12 +++
vcl/qt6/QtAccessibleWidget.cxx | 12 +++
vcl/qt6/QtBitmap.cxx | 12 +++
vcl/qt6/QtClipboard.cxx | 12 +++
vcl/qt6/QtData.cxx | 12 +++
vcl/qt6/QtDragAndDrop.cxx | 12 +++
vcl/qt6/QtFilePicker.cxx | 12 +++
vcl/qt6/QtFont.cxx | 12 +++
vcl/qt6/QtFontFace.cxx | 12 +++
vcl/qt6/QtFrame.cxx | 12 +++
vcl/qt6/QtGraphics.cxx | 12 +++
vcl/qt6/QtGraphics_Controls.cxx | 12 +++
vcl/qt6/QtGraphics_GDI.cxx | 12 +++
vcl/qt6/QtGraphics_Text.cxx | 12 +++
vcl/qt6/QtInstance.cxx | 12 +++
vcl/qt6/QtInstance_Print.cxx | 12 +++
vcl/qt6/QtMainWindow.cxx | 12 +++
vcl/qt6/QtMenu.cxx | 12 +++
vcl/qt6/QtObject.cxx | 12 +++
vcl/qt6/QtOpenGLContext.cxx | 12 +++
vcl/qt6/QtPainter.cxx | 12 +++
vcl/qt6/QtPrinter.cxx | 12 +++
vcl/qt6/QtSvpGraphics.cxx | 12 +++
vcl/qt6/QtSvpSurface.cxx | 12 +++
vcl/qt6/QtSvpVirtualDevice.hxx | 12 +++
vcl/qt6/QtSystem.cxx | 12 +++
vcl/qt6/QtTimer.cxx | 12 +++
vcl/qt6/QtTools.cxx | 12 +++
vcl/qt6/QtTransferable.cxx | 12 +++
vcl/qt6/QtVirtualDevice.cxx | 12 +++
vcl/qt6/QtWidget.cxx | 12 +++
vcl/qt6/QtXAccessible.cxx | 12 +++
78 files changed, 1137 insertions(+), 17 deletions(-)

Upstream: cgit.freedesktop.org


  • Share