Painting Examples

Qt's painting system is able to render vector graphics, images, and outline font-based text with sub-pixel accuracy using anti-aliasing to improve rendering quality.

These examples show the most common techniques that are used when painting with Qt, from basic concepts such as drawing simple primitives to the use of transformations.

Affine Transformations

Demonstrates how affine transformations in QPainter works.

Basic Drawing Example

The Basic Drawing example shows how to display basic graphics primitives in a variety of styles using the QPainter class.

Composition Modes

Demonstrates how Composition Modes work in QPainter.

Concentric Circles Example

Demonstrates the improved quality that antialiasing and floating point precision gives.

Font Sampler Example

The Font Sampler example shows how to preview and print multi-page documents.


Shows how gradients can be used with QPainter.

Image Composition Example

Shows how composition modes work in QPainter.

Painter Paths Example

The Painter Paths example shows how painter paths can be used to beuild complex shapes for rendering.

Path Stroking

The Path Stroking example shows various types of pens that can be used with QPainter.

Transformations Example

The Transformations example shows how transformations influence the way that QPainter renders graphics primitives.

Vector Deformation

Demonstrates how to manipulate the elements of a QPainterPath.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.