[Interest] What happens when mixing QWidgets and QML in Qt6?

Halla Rempt boud at valdyas.org
Sun Mar 7 17:10:12 CET 2021


We were discussing ways of adding QML components to Krita, in the context of hardware acceleration, and I'm not sure we correctly understand what is going on.

The question is, if we have a QMainWindow and some QWidget components and some QML components, are in Qt6, the QML components rendered using QRhi using the platform specific renderer, or using QRhi using OpenGL, or using OpenGL directly? Is that true for all platforms (X11, Wayland, Android, macOS, iOS, Windows 10)?

Right now, we just don't know what to do. We currently have an OpenGL canvas widget, rendered using Angle on Windows, because on Windows you cannot use OpenGL directly, which also uses the opengl QPainter backend to render things like cursor outlines. Most UI components are QWidgets, some use QML.

When porting to Qt6, I'm still not sure what we should do:

* Keep our code and hack Qt6 to render OpenGL using Angle on Windows and MetalAngle on macOS/iOS.

* Keep our code and make QMdiArea compatible with QWindow (or use KDDockwidgets) using createWindowContainer and implement three different canvas implementations (d3d, metal, opengl) and reimplement the canvas decoration painting for each canvas.

* Recreate our canvas class using QRhi, like Ossia does (https://github.com/ossia/), and still mix qwidgets and qml components for the time being.

* And we also want to recover something that we've lost with the port to Qt5, namely having a separate QML-based touch/tablet UI that re-uses the GPU accelerated canvas we already have.

Has anyone any experience choosing a path forward in a similar situation?

Cheers,

Halla


-- 
https://www.krita.org




More information about the Interest mailing list