MCPcopy Create free account
hub / github.com/KDE/kdiff3 / colorToPixmap

Function colorToPixmap

src/PixMapUtils.cpp:47–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45} // namespace
46
47QPixmap colorToPixmap(const QColor& inColor)
48{
49 QPixmap pm(16, 16);
50 QPainter p(&pm);
51 p.setPen(Qt::black);
52 p.setBrush(inColor);
53 p.drawRect(0, 0, pm.width(), pm.height());
54 return pm;
55}
56
57/*
58 Copy pm2 onto pm1, but preserve the alpha value from pm1 where pm2 is transparent.

Callers 1

initPixmapsFunction · 0.85

Calls 2

setPenMethod · 0.80
widthMethod · 0.80

Tested by

no test coverage detected