QPaintEngine - OpenGL and DirectX
-
Dear Qt Community,
I have been struggling to take control of the QPaintEngine type. More specifically, I woud like to know whether I am using DirectX or OpenGL for rendering, or the CPU?
And is it possible to manually ask the engine to use a specific GPU back-end, considering the fact that one may have both OpenGL and DirectX installed on Windows.
Thank you for your help!
-
QPainter uses the raster engine, you can make use of an OpenGL viewport for QGraphicsView when using the Graphics View framework.
Vulkan support came in a later version of Qt.
Are you locked to 5.9 ?
I think you will be interested in Qt's RHI but that requires at least 5.15.
-
Hi and welcome to devnet,
What is your use case ?
Widgets ?
QtQuick ?
Which version of Qt ? -
Hi @SGaist ,
Thanks for the kind welcoming words and sorry for the huge delay. I somehow didn't receive any email notification that someone has reacted on the topic.
Well, my use case is drawing simpe 2D primitives for an automation system. It will run on x86, x86-64 (with any GPU) ARM32 and ARM64 (with Mali GPU).
Widgets ?
-> No widgets, pure QPen and QBrush only.QtQuick ?
-> No, not at all.Which version of Qt ?
-> 5.9.7My final goal is to be able to "instruct" the painting engine to use DirectX, OpenGL or Vulkan (if supported by Qt) manually. I imagine a line telling the QPaintEngine what to use as part of my app initialisation.
Right now, how can I know what is under the hood in case I have both DirectX and OpenGL installed on my Windows 10?
-
QPainter uses the raster engine, you can make use of an OpenGL viewport for QGraphicsView when using the Graphics View framework.
Vulkan support came in a later version of Qt.
Are you locked to 5.9 ?
I think you will be interested in Qt's RHI but that requires at least 5.15.