From: nds Date: Fri, 15 Apr 2016 12:42:07 +0000 (+0300) Subject: #1309 Management of icons: loadIcon in icon factory, sketch->parallel icon processing X-Git-Tag: V_2.3.0~212 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5b5158fa94240f54398c6dc3d15fdd76b6349375;p=modules%2Fshaper.git #1309 Management of icons: loadIcon in icon factory, sketch->parallel icon processing --- diff --git a/src/ModuleBase/ModuleBase_IconFactory.cpp b/src/ModuleBase/ModuleBase_IconFactory.cpp index ed2719816..479e681cc 100644 --- a/src/ModuleBase/ModuleBase_IconFactory.cpp +++ b/src/ModuleBase/ModuleBase_IconFactory.cpp @@ -34,3 +34,14 @@ QIcon ModuleBase_IconFactory::getIcon(ObjectPtr theIcon) { return QIcon(); } + +QIcon ModuleBase_IconFactory::loadIcon(const QString& theValue) +{ + QIcon anIcon(theValue); + + if (anIcon.isNull()) { + + } + + return anIcon; +} diff --git a/src/ModuleBase/ModuleBase_IconFactory.h b/src/ModuleBase/ModuleBase_IconFactory.h index 1fda9b43b..5ea4c4273 100644 --- a/src/ModuleBase/ModuleBase_IconFactory.h +++ b/src/ModuleBase/ModuleBase_IconFactory.h @@ -25,6 +25,13 @@ public: /// \param theObj an object virtual QIcon getIcon(ObjectPtr theObj); + /// Finds an icon for the given object. The icon is loaded: firstly from qrc file, + /// then by the icon path. If the path contains ":" , it will be treated as absolute path to + /// the icon, or relative path from the plugin library + /// \param theValue an icon information + /// \return a loaded or empty icon + static QIcon loadIcon(const QString& theValue); + protected: ModuleBase_IconFactory(); diff --git a/src/PartSet/PartSet_icons.qrc b/src/PartSet/PartSet_icons.qrc index fada5b9de..87a2d7dc9 100644 --- a/src/PartSet/PartSet_icons.qrc +++ b/src/PartSet/PartSet_icons.qrc @@ -45,7 +45,6 @@ icons/dimension_v.png icons/radius.png icons/perpendicular.png - icons/parallel.png icons/partition.png icons/length.png icons/distance.png diff --git a/src/PartSet/icons/parallel.png b/src/PartSet/icons/parallel.png deleted file mode 100644 index 8d152d3be..000000000 Binary files a/src/PartSet/icons/parallel.png and /dev/null differ diff --git a/src/SketchPlugin/CMakeLists.txt b/src/SketchPlugin/CMakeLists.txt index 77f7e1f32..165ad0f42 100644 --- a/src/SketchPlugin/CMakeLists.txt +++ b/src/SketchPlugin/CMakeLists.txt @@ -101,8 +101,13 @@ INCLUDE_DIRECTORIES( ../SketcherPrs ) +SET(ICON_RESOURCES + icons/parallel.png +) + INSTALL(TARGETS SketchPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES}) INSTALL(FILES ${XML_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) +INSTALL(FILES ${ICON_RESOURCES} DESTINATION ${SHAPER_INSTALL_XML_RESOURCES}) ADD_UNIT_TESTS(TestSketchPointLine.py TestSketchArcCircle.py diff --git a/src/SketchPlugin/icons/parallel.png b/src/SketchPlugin/icons/parallel.png new file mode 100644 index 000000000..8d152d3be Binary files /dev/null and b/src/SketchPlugin/icons/parallel.png differ diff --git a/src/SketchPlugin/plugin-Sketch.xml b/src/SketchPlugin/plugin-Sketch.xml index 725bc554b..38b0854d0 100644 --- a/src/SketchPlugin/plugin-Sketch.xml +++ b/src/SketchPlugin/plugin-Sketch.xml @@ -379,7 +379,8 @@ - +