MCPcopy Create free account
hub / github.com/KDE/kdevelop / textIcon

Function textIcon

plugins/git/simplecommitform.cpp:25–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#include <QVBoxLayout>
24
25QPixmap textIcon(const QString& str, const QColor& fg = Qt::black, const QColor& bg = Qt::white)
26{
27 QPixmap ret(40, 40);
28 QPainter p(&ret);
29 QFont font = p.font();
30 font.setPixelSize(0.625 * 40);
31 p.setFont(font);
32 ret.fill(bg);
33 p.setPen(fg);
34 p.drawText(ret.rect(), Qt::AlignCenter, str);
35 return ret;
36}
37
38SimpleCommitForm::SimpleCommitForm(QWidget* parent)
39 : QWidget(parent)

Callers 1

SimpleCommitFormMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected