SAmple project qt Tutorial is not posssible to deploy in release mode. App's icons are not loaded

I am trying to deploy the qt Tutorial, I compiled in release mode and put all necessary dlls to deploy more or less all done. But when clicking the exe, it is not loading the icons on tools. They are written in .ts file which is compiled wit qt's translator using -qm and .qm files generated.

icons being loaded from within Visual studio IDE but when trying to run app from standalone folder, app is being loaded but icons are not mapped only textual menus are loaded.

If anyone can help to solve it will appreciate it. Thanks in advance,.

Kirill Gavrilov's picture

According to the code (samples/qt/Common/src/ApplicationCommon.cxx):

QString ApplicationCommonWindow::getResourceDir()
  static QString aResourceDir =
    QString (OSD_Environment ("CSF_ResourcesDefaults").Value().ToCString());
  if (aResourceDir.isEmpty())
    aResourceDir = QString (OSD_Environment ("CSF_OCCTResourcePath").Value().ToCString()) + "/samples";

  return aResourceDir;
rem samples/qt/IESample/env.bat
set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res"
set "CSF_ResourcesDefaults=%RES_DIR%"
set "CSF_IEResourcesDefaults=%RES_DIR%"

these resource files (images, translation files Common-string.qm, Interface-string.qm, etc.) are loaded from the directory specified by environment variables like CSF_ResourcesDefaults  / CSF_IEResourcesDefaults.