QT and QT Quick graphic Backend
-
Hey,
I know that Qt can configure with a lot of graphic backends but I suspicious that which kind of QT API actually use graphic backend, of course QT 3D API such as (QOpenGLWidget,...) use graphic backend but how about Qpainter and other which one use real hardware accelerate and which one doesn't use?Best Regards,
-
Hi,
The backends are platform specific e.g. the xcb backend run on Unix like OSes but not on Windows but it provides integration with hardware acceleration trough the Xorg server.
QPainter uses by default the raster engine but again the application uses xcb as the backend.
You have more alternatives here.
-
@SGaist thanks for your reply,might be I could not explain the problem clearly I know that Qt uses graphic backends such as xcb,eglfs,... thing that i doubt is that I don't know does QPainter use opengl when eglfs selected as a graphic backend or not? in the other words does Qpainter use hardware acceleration or not(when eglfs selected)?
-
@Alien said in QT and QT Quick graphic Backend:
in the other words does Qpainter use hardware acceleration or not(when eglfs selected)?
no - not directly
-
@raven-worx what should I do in this case?
Imagine I want to create custom QML component if I inherit from QQuickPaintedItem and override "paint" method and use Qpainter I can't get benefit of hardware accelerate,right?In this case what do you suggest me?
-
Did you try to build changing RenderTarget ?
-
Do you mean a constructor that calls setRenderTarget ?
-
Dear @SGaist ,
as https://conf.qtcon.org/system/attachments/137/original/writing-custom-qtquickcomponents-QtCon.pdf%3F1473164662 explain on page 16 subclass from QQuickPaintedItem and using Qpainter is slow approach but subclass from QQuickItem is fast (H.W accelerate) approach also you can subclass from QQuickFrameBufferObject(H.W accelerate). Qpainter API is a kind of convenience and easy API but as I said it's either kind of slow API.I just want to know if my understanding is right and Qpainter is slow API for drawing?
I really appreciate your help.
-
Yes, QPainter is usually slower because it uses the raster engine.