April 2018
Beginner
714 pages
18h 21m
English
If you look at the result of the previous screenshot, you can probably note that the drawing looks pixelated. This happens because each pixel in a line is completely black, and all the surrounding pixels are completely white. The physical display's resolution is limited, but a technique called anti-aliasing allows you to produce more smooth images with the same resolution. When drawing a line with anti-aliasing, some pixels will be more or less blacker than others, depending on how the line crosses the pixel grid.
You can easily enable anti-aliasing in Graphics View using the following code:
view.setRenderHint(QPainter::Antialiasing);
With the anti-aliasing flag turned on, the painting is done much more smoothly:
However, lines ...
Read now
Unlock full access