PDA

View Full Version : Custom QGraphicsView



qtoptus
2nd December 2010, 05:58
Hallo,

I want to make use of the QGraphicsScene and/or QGraphicsView but using a different rendering system than the native or OpenGL. Is this something doable? What components I need to re-implent, wrap, or ignore to use Direct3D rendering for example?

Thanks.

high_flyer
2nd December 2010, 08:49
You might want to have a look at:
http://doc.trolltech.com/4.7/paintsystem.html
and
http://doc.trolltech.com/4.7/qpaintengine.html

wysota
2nd December 2010, 09:06
You can also implement you own graphics system but that's.... hell lots of work.

qtoptus
2nd December 2010, 15:33
Thanks for your information.

Since the idea is possible and no restriction is made regarding what graphics engine is used, I was thinking if the idea really worth the effort. The reason I'm thinking of implementing a custom graphics engine using Direct3D is that driver issues of the "unstable" OpenGL, especially with some laptops that comes with low quality built-in video chips. And since my only target platform is Windows, then it would be more portable to use something like Direct3D to ensure reliability of the graphics. However, why not use the Qt pixel engine instead? My concern here is only performance. I don't know if the native Qt paint system is accelerated, or what graphics API it uses. How capable is it to render textured polygons in 2D or perform shader effects...etc.

Cheers.

wysota
2nd December 2010, 16:46
I don't know if the native Qt paint system is accelerated,
There is no single "native" paint system. Qt uses different paint systems on different platforms by default. You can override that with -graphicssystem switch.


or what graphics API it uses.
On Windows graphics operations are done using the so called "raster engine" Qt has (which is very optimized) and then blitted to Windows surfaces using GDI.


How capable is it to render textured polygons in 2D or perform shader effects...etc.
The only acceleration API Qt officially supports is OpenGL (and GLSL for shaders). There used to be a Direct3D backend but it is not maintained anymore and very likely incompatible with the current needs of Qt.

You should be quite ok with the raster engine, in many cases it's much faster than the accelerated GL backend.