1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_IconFactory.cpp
4 // Created: 28 Jul 2015
5 // Author: Vitaly SMETANNIKOV
7 #include "ModuleBase_IconFactory.h"
9 #include "Config_XMLReader.h"
13 ModuleBase_IconFactory* MYIconFactory = 0;
16 ModuleBase_IconFactory::ModuleBase_IconFactory()
21 void ModuleBase_IconFactory::setFactory(ModuleBase_IconFactory* theFactory)
25 MYIconFactory = theFactory;
28 ModuleBase_IconFactory* ModuleBase_IconFactory::get()
31 MYIconFactory = new ModuleBase_IconFactory();
36 QIcon ModuleBase_IconFactory::getIcon(ObjectPtr theIcon)
41 QIcon ModuleBase_IconFactory::loadIcon(const QString& theValue)
43 QPixmap aPixmap(theValue);
45 if (aPixmap.isNull()) {
46 std::string aPluginPath = Config_XMLReader::pluginConfigFile();
47 QString anIconPath = QString::fromStdString(aPluginPath) + QDir::separator() +
49 if (QFile::exists(anIconPath))
50 aPixmap = QPixmap(anIconPath);
52 return QIcon(aPixmap);