#include#include QPainter painter(this); QPainterPath circlePath; circlePath.addEllipse(100, 100, 100, 100); painter.setClipPath(circlePath); painter.fillRect(0,0, 300, 300, Qt::blue);
#includeIn this example, a rectangular path is created using the addRect() function of QPainterPath class. This path is then set as the clipping path using setClipPath() function. Finally, a red rectangle is drawn using fillRect() function, but it is clipped to the rectangular path. Package/library: Qt5Gui Overall, it seems like the examples are using the Qt5Gui package/library, which provides graphical user interface functionality for Qt5 applications.#include QPainter painter(this); QPainterPath rectPath; rectPath.addRect(50, 50, 200, 200); painter.setClipPath(rectPath); painter.fillRect(0,0, 300, 300, Qt::red);