MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / customIcon

Method customIcon

customWidgets.cpp:7–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5//*********************************************************//
6
7customIcon::customIcon(QString iconPath, QString hint, int r, QWidget *parent):
8 QPushButton(parent),
9 radius(r),
10 iconHint(hint){
11 QSvgRenderer renderer;
12 renderer.load(iconPath);
13 QSize size = renderer.defaultSize();
14 iconImg = new QPixmap(size);
15 iconImg->fill(Qt::transparent);
16 QPainter painter(iconImg);
17 painter.setRenderHints(QPainter::Antialiasing);
18 renderer.render(&painter);
19
20 widgetRatio = iconImg->height() / iconImg->width();
21 bgColor = defaultColor;
22}
23
24customIcon::customIcon(const QPixmap &icon, QString hint, int r, QWidget *parent):
25 QPushButton(parent),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected