[Interest] some doubts about current graphics stack in Qt 5.1
Till Oliver Knoll
till.oliver.knoll at gmail.com
Mon Dec 9 22:30:21 CET 2013
Am 09.12.2013 um 11:13 schrieb "pritam.ghanghas at gmail.com" <pritam.ghanghas at gmail.com>:
> Within Qt
> QtWIdgets use QPainter, which can use raster, native or opengl backends. Most of the time it will be raster. But if one is using QGLWidget or sets a QGLWidget as viewport. QPainter will switch to opengl. There are non programmatic ways as well to make OpenGl default.
Just for the (historical) record: in Qt 4.x there /is/ a way to programatically set the default painter, even an OpenGL based one for "plain QWidgets" (ie non- QGLWidget based ones).
The actual API call escapes me currently, but it was either some static method call in QPaintEngine before instantiating QApplication, or a flag in the c'tor of QApplication or the like.
One can even pass the "default paint engine" as runtime parameter, like -paintengine=[raster|native|opengl] (again refer to google for the actual syntax).
The results with an OpenGL painter - at least on Mac OS X - were... well... "surprising", so say the best ;)
I think the entire concept of a "paint engine" in Qt 5 is gone (and has probably conceptionally been replaced by the QPA architecture or so). And as Thiago said there is apparently no "native painting" anymore (well, eventually there is, I guess, when the "finished pixmap needs to be rendered on the screen").
More information about the Interest