The QPainter class can be used to draw (and basically paint) on any Qt class that is a subclass of the QPaintDevice class. What does that mean? It means basically anything including Qt widgets, that have a visual side and something can be drawn on them. So to name a few, QPainter can be used to draw on a QWidget class (which means basically all existing and custom made Qt widgets), QImage, QPixmap, and many other Qt classes. You can see the QPaintDevice class documentation page in Qt Creator Help mode for a full list of Qt classes that inherit QPaintDevice. QPainter has numerous functions, a lot of which have names starting with draw, and covering all of them would need a whole chapter by itself, but we are going to see ...
The QPainter class
Get Computer Vision with OpenCV 3 and Qt5 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.