MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / sGetIcon

Method sGetIcon

src/Gui/ApplicationPy.cpp:1588–1604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1586}
1587
1588PyObject* ApplicationPy::sGetIcon(PyObject* /*self*/, PyObject* args)
1589{
1590 char* iconName = nullptr;
1591 if (!PyArg_ParseTuple(args, "s", &iconName)) {
1592 return nullptr;
1593 }
1594
1595 PythonWrapper wrap;
1596 wrap.loadGuiModule();
1597 wrap.loadWidgetsModule();
1598 auto pixmap = BitmapFactory().pixmap(iconName);
1599 if (!pixmap.isNull()) {
1600 return Py::new_reference_to(wrap.fromQIcon(new QIcon(pixmap)));
1601 }
1602
1603 Py_Return;
1604}
1605
1606PyObject* ApplicationPy::sIsIconCached(PyObject* /*self*/, PyObject* args)
1607{

Callers

nothing calls this directly

Calls 6

new_reference_toFunction · 0.85
loadGuiModuleMethod · 0.80
loadWidgetsModuleMethod · 0.80
pixmapMethod · 0.80
fromQIconMethod · 0.80
isNullMethod · 0.45

Tested by

no test coverage detected