Hi Halla, With Mixxx we are also facing big challenges deciding how to replace old OpenGL code when moving to Qt6. Our old OpenGL code relies on an API of QGLWidget which was removed in Qt6 with no replacement. I don't know the answer to your questions about mixing QWidgets and QML, but for Mixxx's case it seems the most reasonable path to Qt6 for us is rewriting our entire GUI with Qt Quick, which we've talked about doing for years anyway. I posted about that on this list a few months ago and received no answers...
https://forum.qt.io/topic/121746/determing-graphics-frame-swap-time-when-rendering-in-qt-6 Trying to hack Qt6 to use ANGLE seems like not an easily maintainable path considering this is no longer supported upstream. I suspect it may not be easy, but I don't really know. I'd suggest putting that effort towards a solution that is more aligned with upstream's direction. Rewriting the same code 3 times for Direct 3D, Metal, and OpenGL also does not seem like a good idea for long term maintenance. IIUC, the purpose of RHI is so you don't need to do that. So I'd suggest rewriting your code using QRhi. On 3/7/21 10:10 AM, Halla Rempt wrote:
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
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest