Showing items from Qt

Rendering QGraphicsItem into QPixmap

I was in need of rendering a QGraphicsItem into a QPixmap outside of the QGraphics framework. Although the final solution is simple, it took me a while to get it right. As Google wasn’t much of a help here I decided to publish my solution to the problem here. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 …

Continue Reading

Blending colors in Qt

I found myself in need of blending two QColors in Qt using an alpha ratio. As of the time of writing this post the Qt library does not provide this feature. However, it is fairly easy to create such a function yourself. /** * @brief Blend two colors. * @param color1 One of the colors to be blended.

Continue Reading