By reimplementing a custom
paintEvent() and using a
QPainter, we can draw anything we want. This is ideal for custom widgets, but is not at all convenient if we want to draw lots of individual items, especially if we want to provide the user with the ability to interact with the items. For example, in the past some users have created graphical applications using literally thousands of custom widgets to stand as graphical items, and although widget painting is very fast, handling a single mouse click in such situations could easily consume almost the whole CPU’s processing capability. Fortunately, ...