Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Qt4.8(or the Qt 5) do the painting work? [closed]

Tags:

qt

paint

qt5

It is probably as same as "How my program code transition to the GUI on screen device via various Qt5 painting system?"

Since Qt support various kinds of platforms,my questions only base on Linux and Embedded Linux (because both are opensource os and are different in painting :-) )。

My question focus on these topics:

  1. Are QWidgetQGraphicsItemRectangle (in QML) different in the painting system? And what is it?

  2. Which one don't use QPainterQPaintEngine) class?

  3. How many paint engines implemented in Qt4.8 (or Qt5)? For example, QRasterPaintEngine.

  4. If the platform is Linux (with X11 supported), will Qt use X11 API do the painting? Then what's the difference between X11's paint engine and QRasterPaintEngine? If the platform also support OpenGL, then Qt will use X11 API or OpenGL API?

  5. If the GPU supports OpenGL, then Qt may use OpenGL; but if OpenGL is not supported by GPU, then how does Qt treat this situation?

like image 810
gemfield Avatar asked Oct 08 '22 21:10

gemfield


1 Answers

Your question is very broad, Most of which can be answered in the Qt QPaintEngine documentation:

https://doc.qt.io/qt-5/qpaintengine.html

The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a given platform. Qt 4.0 provides several premade implementations of QPaintEngine for the different painter backends we support. We provide one paint engine for each window system and painting framework we support. This includes X11 on Unix/Linux and CoreGraphics on Mac OS X. In addition we provide QPaintEngine implementations for OpenGL (accessible through QGLWidget) and PostScript (accessible through QPSPrinter on X11). Additionally there is a raster-based paint engine that is a fallback for when an engine does not support a certain capability.

like image 140
Phil Hannent Avatar answered Oct 12 '22 01:10

Phil Hannent